In the Doctor Who episode "Before the Flood",
Clara, Cass, and Lunn are surprised to discover the Doctor popping out of the stasis chamber, having been in there for over 100 years since the dam broke.
We also see that
when the dam breaks (in the past), an emergency protocol of the TARDIS activates and takes Bennett and the TARDIS elsewhere (presumably somewhere safe). The episode is not clear where the TARDIS is going.
At the end of the episode,
Bennett and the TARDIS have clearly been reunited with the Doctor and the other people in the undersea base.
All this taken together seems like a loose end that was not tied up in the episode. How did the TARDIS get back to the Doctor?