In the last episode of season 7, The Doctor goes into his timeline to save Clara. It ends when they see his war regeneration and Clara faints. Did I miss a special episode between that one and the 50th anniversary special? Because they never explained how they escaped his timeline.
Presumably, the Doctor led her out. He was shown to be immune to the scattering effect that the Great Intelligence and Clara experienced, and it is his own personal time-tunnel, so one would assume that it would be familiar to him.
Before entering the timestream, the Doctor says to Vastra, Jenny, and Strax, “If I don't make it back, and I might not…,” which implies that there is only a chance that he will not return (which is referring to the possibility of the timestream collapsing in on itself as a result of the paradoxes caused by him being in it).