Increasing fidelity is the ultimate challenge of quantum information technology. In addition to decoherence and dissipation, fidelity is affected by internal imperfections such as impurities in the system. Here we show that the quality of quantum revival, i.e., periodic recurrence in the time evolution, can be restored almost completely by coupling the distorted system to an external field obtained from quantum optimal control theory. We demonstrate the procedure with wave-packet calculations in both one- and two-dimensional quantum wells, and analyze the required physical characteristics of the control field. Our results generally show that the inherent dynamics of a quantum system can be idealized at an extremely low cost.