Quantum coherent control and compensation of temporal scattering