Agents for treating keratin-containing fibers, in particular human hair, containing, in a cosmetically acceptable carrier: at least one anionic setting copolymer encompassing at least one structural unit of formula (I) and at least one structural unit of formula (II) and at least one structural unit of formula (III), in which R1 denotes a hydrogen atom or a methyl group, R2 denotes a hydrogen atom or a methyl group, R3 denotes a branched (C1 to C20) alkyl group, a branched (C2 to C6) hydroxyalkyl group, or a *-(CH2CH2O)n—R6 group where R6=branched (C1 to C20) alkyl and n=1 to 30, R4 and R5 denote a hydrogen atom, or one of the two residues denotes a hydrogen atom and the other a methyl group, are suitable for temporary reshaping of hair and for imparting shine, in particular as an aerosol hair spray or aerosol hair foam.