We propose a new strategy for ultrafast magnetization reversal of nanomagnets. Due to the Inverse Faraday Effect, circularly polarized optical pulses induce a pulsed magnetic flux in materials with large magneto-optical susceptibility. Alternatively, intense optical pulses can induce a pulsed magnetic flux by means of ultrafast demagnetization of a metallic thin film or multilayer with a perpendicular magnetic anisotropy. The time varying magnetic flux induces a transient electro-motive force and electric current in a conducting loop on the surface of the illuminated material, and hence a transient magnetic field. The magnetic field pulses due to the transient current appear to be too short for use in the magnetic field or spin-current induced precessional switching of magnetization. However, our calculations suggest that the magnetic field could lead to ultrafast switching of a nanomagnet overlaid on the surface of the conductor and demagnetized by the same optical pulse. In the case of magnetic pulses due to the Inverse Faraday Effect, the switching direction could be controlled by the helicity of the optical pulse.