We implement a simple feedback mechanism on a two-mode cavity QED system to preserve the Zeeman coherence of a ground state superposition that generates quantum beats on the second-order correlation function. Our investigation includes theoretical and experimental studies that show how to prevent a shift away from the Larmor frequency and associated decoherence caused by Rayleigh scattering. The protocol consists of turning off the drive of the system after the detection of a first photon and letting it evolve in the dark. Turning the drive back on after a pre-set time reveals a phase accumulated only from Larmor precession, with the amplitude of the quantum beat more than a factor of two larger than with continuous drive.