Oh I duno.
Regenerate, and have the new form finish it up with lyra and derpy?
He won't be himself, but asuming he ggives one of them thhe details, it's just a matter of reading the manual for the next doctor.
or the next doctor can just tap into his memory.
At least that's my theory.