  Thermo- and photo- acoustic tomography require reconstructing initial
acoustic pressure in a body from time series of pressure measured on a surface
surrounding the body. For the classical case of free space wave propagation,
various reconstruction techniques are well known. However, some novel
measurement schemes place the object of interest between reflecting walls that
form a de facto resonant cavity. In this case, known methods (including the
popular time reversal algorithm) cannot be used. The inverse problem involving
reflecting walls can be solved by the $gradual$ $time$ $reversal$ method we
propose here. It consists in solving back in time on the interval $[0,T]$ the
initial/boundary value problem for the wave equation, with the Dirichlet
boundary data multiplied by a smooth cut-off function. If $T$ is sufficiently
large one obtains a good approximation to the initial pressure; in the limit of
large $T$ such an approximation converges (under certain conditions) to the
exact solution.
