The direction of the magnetic field around a wire depends on
the direction of the current flowing through the wire. When you
change the direction of the current in the wire, the direction of the
magnetic field around it also changes direction.
The current in every electric cord in your house changes its direction
120 times every second. So the magnetic field around every electric
cord in your house also changes its direction 120 times every second.