Eucatastrophe
A eucatastrophe is a sudden turn of events in a story that ensures the protagonist does not meet some terrible, impending doom. The concept was created by the philologist and fantasy author J. R. R. Tolkien in his essay "On Fairy-Stories", based on a 1939 lecture. The term has since been taken up by other authors, and by scholars.