- You may be looking for the short story "Afterwords".
Afterword was the final story in the anthology Decalog 3: Consequences. It was written by Steven Moffat and served as a sort of comical epilogue to Continuity Errors, enlightening the reader about Professor Candy's fate.
Professor Candy dictates to one Steven Moffat an afterword to a book of fiction about the Doctor. After explaining to the reader that when they become too involved in the history of a planet, the Doctor has been known to use some sort of "panic button" to retcon all recordings of their activities there into fiction of some sort, Candy appeals to the Doctor — who he know will be reading the book — to finally return him to his home time.
- The Intelligent Tree Spores of Xandar 6 are among the cultures who nearly discovered the Doctor's existence, only to have him go back in Time and introduce himself into their popular culture as a fictional character, one of their most enduring bark carving characters.
- The clear metafictional implication is that Decalog 3: Consequences itself is the book created by the Doctor, with the Doctor having applied the "panic button" to Earth itself.