The meaning "device for changing the direction of something or making or breaking a connection" is first recorded 1797. "The peg sense suits the mech(anical) applications" [Weekley]; also compare switchblade. These senses in English might be a direct borrowing from those senses in Continental Germanic languages rather than a continuation of the "pliant wand" sense. The meaning "a change from one to another, a reversal, an exchange, a substitution" is first recorded 1920; extended form switcheroo is by 1933.
species of willow with tough, flexible branches used in basket-work, c. 1300, "a willow switch," from 14c. of the tree itself, from Old French osier, ozier "willow twig" (13c.) and directly from Medieval Latin osera, osiera "willow," ausaria "willow bed," a word of unknown origin, perhaps from Gaulish. Old English had the word as oser, from Medieval Latin.
also cutout, 1851, in reference to a kind of switch on a circuit to cut out an instrument, from the verbal phrase, from cut (v.) + out (adv.). The verbal phrase is attested from c. 1400 as "cut so as to take out;" from 1550s as "fashion or shape by cutting;" from 1736 as "remove, excise, omit." From 1640s as "be naturally formed or fashioned" (for some specified purpose).