We present a deterministic strategy to obtain a high-fidelity reconstruction of the exit-surface wave of a specimen of condensed matter from its diffraction pattern. The direct solution of a set of linear equations extracted from the inverse Fourier transform of the diffraction pattern (which is the autocorrelation of the exit-surface wave) is followed by a simple regularization step in which inconsistencies in the data are corrected. This approach is illustrated using the diffraction pattern of a gnat's wing, illuminated with a laser. We also show that a well-defined residual serves as a proxy for the fidelity of the retrieved exit-surface wave. In addition the residual provides a more stringent test of reconstruction quality than has been previously available in conventional iterative phase retrieval procedures and is easily calculated as an integral component of such methods.