  We present a scheme to neutralize the dephasing effect induced by classical
noise on a qubit. The scheme builds upon the key idea that this kind of noise
can be recorded by a classical device during the qubit evolution, and that its
effect can be undone by a suitable control sequence that is conditioned on the
measurement result. We specifically demonstrate this scheme on a
nitrogen-vacancy (NV) center that strongly couples to current noise in a nearby
conductor. By conditioning the readout observable on a measurement of the
current, we recover the full qubit coherence and its intrinsic coherence time
$T_2$. We demonstrate that this scheme provides a simple way to implement
single-qubit gates with an infidelity of $10^{-2}$ even if they are driven by
noisy sources, and we estimate that an infidelity of $10^{-5}$ could be reached
with additional improvements. We anticipate this method to find widespread
adoption in experiments using fast control pulses driven from strong currents,
in particular in nanoscale magnetic resonance imaging, where control of peak
current s of 100 mA with a bandwidth of 100 MHz is required.
