We demonstrate active control of inhomogeneous dephasing and rephasing for single collective atomic spin excitations (spin waves) created by spontaneous Raman scattering in a quantum memory based on cold 87Rb atoms. The control is provided by a reversible external magnetic field gradient inducing an inhomogeneous broadening of the atomic hyperfine levels. We demonstrate experimentally that active rephasing preserves the single photon nature of the retrieved photons. Finally, we show that the control of the inhomogeneous dephasing enables the creation of time-separated spin waves in a single ensemble followed by a selective read-out in time. This is an important step towards the implementation of a functional temporally multiplexed quantum repeater node.