What happens to the magnetic field in an electromagnet when current though the coil is reversed?

The magnetic field in an electromagnet is created in the core of that device by the movement of current through the coil of wire around the core. For the electromagnet to be effective, the current must be moving in one direction only. If the current is reversed rapidly back and forth (like if AC is applied), the electromagnet won't work. If the DC current simply undergoes a polarity change, the electromagnet will still work pretty much as well as it did, and that's that. Let's look just a bit further for the fun of it.

If we wrap a coil of wire about a ferromagnetic core and run DC through it, it will act as an electromagnet. If we shut the current off, the magnetic field about the coil disappears. The core will lose most of its magnetism, but a little will remain, and this is what we call residual magnetism. If we reverse the DC and turn the power back on, the electromagnet will again be operating, but with a tiny bit of loss due to the fact that a little bit of the core material was magnetically polarized in the opposite direction. It's not a big deal, but it might be helpful in the future. The residual magnetism left in the core by the original direction of the current flow will detract slightly from the new magnetic field set up when the polarity of the applied voltage is reversed.
The magnetic field in an electromagnet is created in the core of that device by the movement of current through the coil of wire around the core. For the electromagnet to be effective, the current must be moving in one direction only. If the current is reversed rapidly back and forth (like if AC is applied), the electromagnet won't work. If the DC current simply undergoes a polarity change, the electromagnet will still work pretty much as well as it did, and that's that. Let's look just a bit further for the fun of it.

If we wrap a coil of wire about a ferromagnetic core and run DC through it, it will act as an electromagnet. If we shut the current off, the magnetic field about the coil disappears. The core will lose most of its magnetism, but a little will remain, and this is what we call residual magnetism. If we reverse the DC and turn the power back on, the electromagnet will again be operating, but with a tiny bit of loss due to the fact that a little bit of the core material was magnetically polarized in the opposite direction. It's not a big deal, but it might be helpful in the future. The residual magnetism left in the core by the original direction of the current flow will detract slightly from the new magnetic field set up when the polarity of the applied voltage is reversed.