1675, shortened form of
periwig. Meaning "person who wears a wig (professionally)" is from 1828. The verb meaning "to behave hysterically" (usually with out) is attested from 1955, from notion in to flip one's wig. Cf. dash my wig!, a former mild imprecation (1797), also