Eucatastrophe

Eucatastrophe is a term coined by J.R.R. Tolkien in one of his letters in 1944.

Etymology
Eu + catastrophe 

Eu is of Greek origin, meaning "good." Catastrophe is an English word meaning "sudden and unexpected disaster."

Thus, the word eucatastrophe is a noun that refers to "a sudden and unexpected good or happy ending" (especially one that follows a catastrophe).

Inspiration
The idea of a sudden and unexpected "happy ending" coming out of bad was drawn from Tolkien's Catholic faith, for he called the "the Incarnation of Christ the eucatastrophe of "human history" and the Resurrection the eucatastrophe of the Incarnation."