Heating it should dispel it, at least temporarily.
Magnetism
(Alteration)
Reversible
Sphere: Elemental Earth
Level:4
Range: Touch
Components: V
Casting Time:7
Duration: 1 rd./level
Area of Effect: 1 object (6 cu.ft./level)
Saving Throw: Neg.
The magnetism spell imbues an object made of iron or steel with magnetic properties. The object attracts iron and steel items approaching within 30 feet. The caster can affect an object of up to six cuber feet per level of experience: thus, a 7th-level priest can affect an object 2x3x7 feet, about the size of a sarcophagus.
Missiles subject to magnetic forces are attracted to the magnetized object and deflected from their intended course. A creature holding an affected item must make a successful saving throw vs. spell each round while in the area of effect, or the item is torn loose and pulled to the magnetized object. An individual wearing affected armor or similar accoutrements must make a saving throw vs. spell each round or be drawn to the object. The force exerted by the magnetic force at the source is 25 pounds per caster level -- this can be used to determine if the magnetically attracted objects can be separated by main strength (see "Maximum Press" on the Strength table in the PHB).
the foregoing assumes the magnetized object is either solidly fixed or more massive than the attracted object. If the object is lighter and not anchored, then it instead moves toward the largest mass of magnetically active material in the area and adheres to it. While the exact effect of this depends on the size of the object, a magnetized object adhering to a weapon may make it difficult or impossible to use, while one adhering to armor may hinder movement or other actions. Typical penalties range from -1 to -4.
The reverse of this spell, demagnetize, can temporarily deactivate a source of magnetism up to 6 cubic feet in volume per caster level. Alternately, it can render one iron or steel object of similar size nonmagnetic for the spell's duration.
Notes: Very rare spell for priests with major access to the sphere of Elemental Earth.
==============
Magnets demagnetizing:
http://www.x-magnet.net/faq.html
=================
EDIT - I found the source of the spell finally: Magnetism (OA)
Oriental Adventures. No wonder I wasn't even close. I went through priest handbook, spells & powers, Tome of Magic and nothing. And once I saw the source listed my mind went: "AH YES, I REMEMBER READING THAT NOW."
Wu-Jen (Level 3)
Magnetism (Alteration) Reversible
Level: 3
Range: 6”
Components: V, S, M
Duration: 3 rounds/Level
Casting Time: 3 Segments
Area of Effect: 3” Radius
Saving Throw: Neg.
This spell can be used in two ways, depending on the desire of the wujen at the moment of casting. If cast upon himself, the spell gives the wujen the ability to draw iron and steel items to his hand upon command. The item must be in the area of effect. Up to one item can be thus called per round. If the item is held by another, that character is allowed a saving throw vs. spell to resist the effect. Repeated attempts can be made upon the same item, provided each attempt is made in a different round.
A wu jen could attempt to snatch weapon from the grasp of others or change the flight of arrows. If the item summoned has greater mass than the wu jen, the effect is opposite – the wu jen is drawn to the item. Attempting to magnetize a man in metal armor normally result in the wu jen being dragged to the target, not always a desirable result. The spell is powerful enough to even pull the wu jen through the air and can be an effective method of crossing chasm provided there is sufficient mass of iron on the other side.
If cast upon another, the victim is allowed a saving throw vs. spell to avoid the effect. Thereafter, all iron and steel items within 3” of the target are drawn to that point. Item in the possession of creatures allow the creature a saving throw as explained above. Again, if the mass of any item is greater than that of the target point, the direction of movement is reversed. In either use, weapons drawn by this spell cause no damage since ther are not wielded or controlled by a conscious mind. Ther material component for this spell is a piece of lodestone.
The reverse of this spell, demagnetize, cancels the effects of magnetism. The material component is a small wooden rod.