A “flip-flop” for the sun's magnetic field