The 1n4001 is what you need. It is a standard diode used commonly for security systems across the magnet coils and solenoids for locking and unlocking doors. It is a counter EMF diode. It kills the spike when the field collapses when the power is cut to the magnet.