We consider the dynamics of an electron in an infinite disordered metallic wire. We derive exact expressions for the probability of diffusive return to the starting point in a given time. The result is valid for wires with or without time-reversal symmetry and allows for the possibility of topologically protected conducting channels. In the absence of protected channels, Anderson localization leads to a nonzero limiting value of the return probability at long times, which is approached as a negative power of time with an exponent depending on the symmetry class. When topologically protected channels are present (in a wire of either unitary or symplectic symmetry), the probability of return decays to zero at long time as a power law whose exponent depends on the number of protected channels. Technically, we describe the electron dynamics by the one-dimensional supersymmetric non-linear sigma model. We derive an exact identity that relates any local dynamical correlation function in a disordered wire of unitary, orthogonal, or symplectic symmetry to a certain expectation value in the random matrix ensemble of class AIII, CI, or DIII, respectively. The established exact mapping from one- to zero-dimensional sigma model is very general and can be used to compute any local observable in a disordered wire.