Single tetracyanoethyelene (TCNE) molecules on Cu(111) are reversibly switched among five states by applying voltage pulses with the tip of a scanning tunneling microscope. A pronounced Kondo resonance in tunneling spectroscopy indicates that one of the states is magnetic. Side bands of the Kondo resonance appear at energies which correspond to inter- and intramolecular vibrational modes. Density functional theory suggests that molecular deformation changes the occupancy in TCNE's molecular orbitals, thus producing the magnetic state.