This term was coined by my beloved J. R. R. Tolkien in his work "On Fairy-Stories" (1947), and can be defined as "sudden turn of events at the end of a story which ensure that the protagonist does not meet some terrible, impending, and very plausible doom". He formed the word by affixing the Greek prefix eu, meaning "good", to catastrophe, the word traditionally used in classically-inspired literary criticism to refer to the "unraveling" or "conclusion" of a drama's plot.
So, next time you stumble upon such an event, you know what to call it.