Since the Master was used as a weapon in the time war odd are The Doctor was too.
The timelords probably forced 8 to regenerate into something that could end the war(Hurt)
Hurt does the job and uses "The moment"
Using one of Moffat's favorite story trick "It happened but didn't happen also"
Hurt is erased and McGann returns but can still remember it happening(Moffat story trick #3453)
McGann runs away but is injured and regenerates into Eccelston