Space-time inversion of stochastic dynamics