Rewritable Optical Memory Based on Sign Switching of Magnetoresistance