Eucatastrophe
A eucatastrophe is a sudden turn of events in a story which ensures that the protagonist does not meet some terrible, impending, and plausible and probable 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.