Plot twist
In literature, a plot twist was a literary device used as an unexpected direction that a story's  could take. Deus ex machina was one such example. 

In Tom Paris' opinion, an unexpected plot twist made a story interesting. In 2373, he proposed that the Insurrection Alpha holonovel could have "Captain Janeway" executing all Maquis conspirators after retaking  with Paris. Co-writer Tuvok disagreed, citing T'Hain's Dictates of Poetics. ()

Upon discovering "Marseilles" kissing a female crewman in sickbay, B'Elanna Torres (playing The Doctor's role in Photons Be Free) described his sending her to engineering so he could give one of her patients a "tonsillectomy" as an "interesting plot twist." ()

External link

Literary devices