In the finale of Dirk Gently's Holistic Detective Agency, the protagonists release the Salaxalan ghost (in Wenton-Weakes' body) in the primordial past, to go fix his ship, when they realize this will doom humanity.
Their solution is to go interrupt Coleridge's composition of Kubla Khan -- which in the story is a poem based on the ghost's story, explanation, and request for help.
How does this stop Wenton-Weakes and the ghost from fixing their ship?
It clearly doesn't stop the ghost from possessing Wenton-Weakes, or from being released in the past (the protagonists say there are now two ghosts - the original one, and now also the one that returned to the past, and has been stuck there another eternity). And, of course, the change to the poem is billions of years later than the change-point where the ghost tries to fix the ship.
(The book's prologue offers a clue - a visual that, in retrospect, we understand as some version of the ghost, crying in anguish at Coleridge being interrupted. But that's not very clear either.)