  Peebles (1989) showed that in the gravitational instability picture galaxy
orbits can be traced back in time from a knowledge of their current positions,
via a variational principle. We modify this variational principle so that
galaxy redshifts can be input instead of distances, thereby recovering the
distances. As a test problem, we apply the new method to a Local Group model.
We infer M = 4 to 8 x 10^{12} M_sun depending on cosmology, implying that the
dynamics of the outlying Local Group dwarves are consistent with the timing
argument. Some algorithmic issues need to be addressed before the method can be
applied to recover nonlinear evolution from large redshift surveys, but there
are no more difficulties in principle.
