Basically, this is playing bait and switchnote with a trope. A work makes you think a trope is going to happen, but it doesn't.
But how could people know a trope is going to happen? Well, tropes live in the minds of the audience. As such, sufficiently Trope Savvy audience members can predict a familiar trope coming based on the hints dropped by the writer. So when the writer decides to build on this expectation, only to reveal that the expected "trope" was a Red Herring while an entirely different situation results, you have a Subverted Trope.
Phrased another way, the work is ultimately revealed not to be using the trope at all, but in the meantime was played up to look like it was.
This is one method of leveraging a trope to give a story texture. It certainly isn't the only way.
A subversion has two mandatory segments. First, the expectation is set up that something we have seen plenty of times before is coming, then that set-up is paid off with something else entirely. The set-up is a trope; the "something else" is the subversion.
To put this another way, a trope of the form "X are often Y" is not subverted by every X you can think of that isn't Y. If someone is murdered and there's a butler around, but he didn't do it, that's not automatically a subversion of The Butler Did It; that's an aversion. But if the writer makes it look like a typical example of The Butler Did It, then reveals he didn't, that's a subversion.
A full comparison could go something like this: A car chase is in progress at reckless speeds. The camera cuts to some workers carrying a Sheet of Glass, then cuts back to the panicked driver headed towards the workers. It seems pretty obvious that the driver is going to smash the glass sheet into a million fragments... or is it?
- If the car drives through the pane of glass, it's played straight.
- If the car drives through the pane of glass, and the workers are heard complaining about why cars that are being chased can avoid nearly everything but a pane of glass, it's lampshaded.
- If the car drives through the pane of glass, and the driver stops to explain the reason why he crashed into it, it's justified.
- If the car misses the pane of glass, it's subverted.
- If something else causes the glass to be broken before the car can even make it to where the glass pane broke, it's also subverted.
- If the car misses the pane of glass but a second car breaks it instead, it's a double subversion.
- If the pane of glass is broken before being hit by the car, which then drives through a different pane of glass carried by a second pair of workers, it's also double subverted.
- Another double subversion is if the car hits the glass and knocks it out of the workers' hands without damage to the glass or car... and the glass crumbles after it gets picked back up.
- If the car comes down the road in a series of wide turns, and it isn't clear if the car will hit the pane of glass (if it ever makes it there), it's zig-zagged.
- If the car disappears from view and isn't seen again until after the sound of glass breaking, it's implied.
- If the car stops before hitting the pane of glass and then takes a different route, it's defied.
- If the car drives into the pane of glass, and not only the glass shatters, but also the car, as well as the workers, it's exaggerated.
- If the car is not doomed to hit the pane of glass, but one of the workers sees the car coming and stops in the street such that the car drives into the pane of glass, it's invoked.
- If the car drives through the glass, and views are shown of damage sustained by the car either complicating the driveability of the vehicle and/or making the car more identifiable to the chasers, or the workers point out the direction of the car to the chasers as they drive by, it's deconstructed.
- However, if the chasing cars get flat tires driving over the glass shards strewn across the street, or if the drivers stop to see to the workers' injuries from the broken glass, it's reconstructed.
- If the car hits the pane of glass, and the chasing car(s) regain their lost trail from the scattered pieces of glass, it's exploited (and also Played for Drama.)
- If the car drives into the pane of glass, and the result is that the glass merely has a car-shaped hole in it, that's downplayed (and also Played for Laughs, but that's another matter. It's also Impact Silhouette played straight.)
- However, if the car drives into the pane of glass, and the result is that the glass merely has a car-shaped hole in it, but the pane of glass collapsed on itself, it's either played straight or a double subversion (And also breaking a downplay).
- If the car drives through the pane of glass backwards, or in any other weird way that a car should not be driving in, it's parodied.
- If the car drives through the pane of glass, but it's the car that shatters (instead of the glass), it's inverted (and a very shoddily-built car at that).
- If the car hits the pane of glass because the driver thought it would be futile to attempt to avoid hitting the glass, it's enforced.
- If the workers are talking about the possibility of a car driving through the glass before the car chase reaches them, it's discussed.
- If the car's occupants mention the number of car chases that lead to a pane of glass being carried across a street, it's conversed.
- If the car drives into the pane of glass, but the glass endures and car bounces back, it is backfired.
- If there is no pane of glass, car chase, or either, it's averted.
Bear in mind that, just as Tropes Are Not Bad, subversions are not automatically good, witty, clever, or original.
Meta Trope Intro compares this with many other ways that a trope can be used.
Every trope page has 'subverted in...' somewhere on it. Please, apply the Wiki Magic!
- A series of Discover credit card ads established a pattern of people calling their customer service line, and having their queries answered by an employee who symbolically looks just like them ("We treat you like you'd treat you"). Then they subverted viewers' expectation that the employee's resemblance was purely symbolic, having the employee in a new ad be the caller's actual identical twin.
- Cross Game: A beautiful girl is attacked by three delinquents. But lo, a hero arrives! With but three mighty punches he decks the villains, saving the girl. Noticing her injured hand he gentlemanly offers to provide medical treatment at his conveniently nearby home...
- Wait a minute... we've seen this hero before. Gasp! He was part of the gang of delinquents — it's an Invoked Trope! Oh dear, what will happen to the beautiful innocent girl now? Will our onlooking heroine warn her in time?!
- Wait... what is the beautiful innocent victim doing now? She's got her cell phone out! She's calling the police! "That was extortion they tried to commit — the police need to know about it." The "delinquents" flee, revealing the truth.
- Rurouni Kenshin has a degree of subversion of the Determinator trope, in how he reacts when he's truly put into a dangerous fight. The layers of his friendly, pacifistic personality start to fall away, until beyond a certain point he becomes the cold-blooded killer he once was.
- In 3-gatsu no Lion, Rei's name uses the kanji for zero and nothingness. However, My Hero Zero is subverted when it just gives his adopted sister Kyoko fuel to taunt him with, as it is not played for Rule of Cool.
Kyoko: You're name is Rei? What a weird name! But it suits you ... "No home. No relatives. No school. No friends."
- Yu-Gi-Oh! ARC-V loves to use the viewer's expectations from previous Yugioh series against them. For example, the Warrior Therapist trope shows up a lot in previous series through duels, usually at the Darkest Hour when the opponent is about to crush them and has just revealed his/her tragic backstory. When Yuya reaches this moment, he doesn't have a way out and the duel has been so brutal that he winds up discovering his Super-Powered Evil Side, accidentally enforcing his opponents views and destroying any chance at redemption or friendship. Furthermore Yuzu, Gongenzaka, Shun, Sergey, Jack, Reira and Reiji repeatedly subvert viewer expectations about their characters based on previous characters with similar roles and traits, especially Reiji.
- The Writing on the Wall has Adventurer Archaeologist Daring Do speculating that the eponymous writing is just a curse meant to scare off superstitious tomb robbers who might otherwise disturb the Ancient Tomb she was exploring, just like she had seen on dozens of similar buildings. She's right about it being meant to scare off tomb robbers, but it isn't a curse - it is a genuine warning against entering. The building isn't a tomb at all; it is an ancient nuclear waste storage facility built by humans.
This is not a place of honor. No great deed is commemorated here. Nothing of value is here.
- Total Drama fanfic Monster Chronicles subverted Kick the Son of a Bitch. Cedric's cruel and horrifying actions towards Alejandro and Duncan are not shown to be deserving and in fact invoke some sympathy for them.
- Like in canon Alejandro is a lying, back-stabbing snake, who charms everyone he comes across to further his own placing in the game, and votes them out once they have been lulled into a false sense of security. However, his torture to near death and soul stealing by Cedric was horrifying and it is made clear that despite Alejandro's actions throughout the game, he does not deserve what happened to him.
- While at first it was amusing to see Cedric picking on Duncan and tormenting him much like the latter would do to Harold in canon, it stops being funny when Cedric's abuse of Duncan grow worse and you see how much danger his life really is in. This comes to a head when Duncan decides to rebel against Cedric, he beats Duncan within an inch of his life, and it's made clear than even if Duncan is at is worst, and if he never reforms he still does not deserve that beating.
- Watchmen: Adrian Veidt is set up to be the ultimate in Ambiguously Gay, with all of the preening attention to his own physical appearance and lack of fighting ability that is associated with that trope. Then somebody tries to shoot him, and he responds by picking up an eight-foot-tall floor lamp and using it to bash the gunman into a fountain, then climbing in after him and demanding to know who sent him while shaking and choking him. Subverted even further when we find out that Veidt hired the assassin himself as a red herring, and when Veidt proceeds to beat the everloving crap out of Nite Owl and Rorschach simultaneously, and then proves his skill further by catching a bullet.
- The ending is a subversion. Rorschach and Nite Owl confront the now realized-to-be-the-evil-villain Adrian, he explains his master plan and when told that he will be stopped, he informs them that he carried out his plan before they even got there.
- Through much of the Pixar's Toy Story 2, Pete the Prospector plays the role of Sage, dispensing advice to other characters. But a glimpse of "Woody's Roundup", the TV show that represents his origin, shows Pete playing a self-sabotaging buffoon. The glimpse hints that his sagely nuggets of wisdom may actually be fool's gold. By the end of the film his true role is revealed.
- The film of Birdy subverts the Downer Ending. All through the film, Al has been trying to get his fellow traumatised Vietnam vet and childhood friend Birdy to respond to him as a human being, but he becomes increasingly convinced that Birdy is suicidal. By the end of the film, Birdy has built himself a pair of wings and is about to jump off a flat roof, so that he can fly. Al knows he's going to do it and races to the roof to stop him. He arrives just in time to see Birdy leap from the roof to certain death. Al screams a Big "NO!" and runs to the edge of the roof... only to find Birdy standing on a different part of the flat roof a few feet below, dusting himself down. Birdy turns around, looks at Al, smiles and says "What?"
- Nightlight (2015) subverts the trope of Found Footage Films. Trailers and excerpts make it look like it's viewed through an In-Universe Camera, but it's actually an Impending Doom P.O.V. sequence from the perspective of a haunted flashlight.
- G. K. Chesterton's The Man Who Knew Too Much. Every single story in it has its amateur detective explaining how a crime was committed. And then, when we expect the arrest, he explains how the criminal is too rich and powerful, or too well-connected, to be arrested, or the arrest would cause too many problems in other situations.
- Överenskommelser by Simona Ahrnstedt:
- You would have expected Deceased Parents Are the Best to be played straight, considering how Beatrice is treated by her uncle. But even though she misses her parents, she can still admit that they had flaws.
- Death by Childbirth is subverted when Sofia gets ecclampsia and becomes very ill, but survives.
- Gerridon and Jamethiel of Chronicles of the Kencyrath were twins, and consorts - as well as the most infamous people in their people's history. Sounds like Villainous Incest, right? Well, no: twincest was culturally sanctioned in their time, and very traditional. And the heroes are shaping up to be twincestuous too!
- The Green-Sky Trilogy does this for False Utopia. Sure, the Kindar are a Perfect Pacifist People with a society built on a Big Lie (the exile of dissenters who became the Erdlings) and has serious issues with narcotic abuse and fading psionic skills...but when the whole thing was exposed due to the High Priestess's Batman Gambit, the Erdlings turn out to be almost as pacifistic as the Kindar, people adjust to the reality in a relatively calm manner, and most make an effort to integrate the societies. By the end of the tie-in game, the society is well on its way to ditch the "false" label entirely.
- In the season 2 finale of Carnivàle, Jonesy strikes Varlyn Stroud unconscious with a log of wood. He then runs into the house that Varlyn was about to enter and rescues Sophie, leaving Varlyn and Varlyns handgun unattended right outside the door. Seconds later, Josey gets shot... By Sophie.
- Dr. Quinn, Medicine Woman seems to have a straight example of Perspective Reversal at first glance. Sully is generally much more progressive than most of the other men in town about almost every issue: ethnical minorities, women's rights, controversial books in the new town library, the theory of evolution, homosexuality... But when it comes to the railway and other building projects, Sully is the one fighting "progress" and the other men are supporting it. Sully has good reasons to dislike that kind of "progress" though, because he knows how this would affect the local Cheyennes, all the animals in the nearby forest and the nature scenes. Which would have been a radical viewpoint in the 1860s/1870s. The other men on the other hand will only want to make a quick profit, and will not care too much about if other values could be lost. So it means that Sully still is the progressive one and the other men the more conservative ones.
- This is a staple of much of the comedy on Mongrels; starting out with what seems to be a buildup to an obvious joke only to quickly turn it around (often lampshading it in the process), like so:
Nelson: How did you get these documents?Badger: Let's just say I have a... "mole" on the inside.(cut to an ordinary-looking person in an office, grabbing documents off a table and sticking them into an envelope)(cut back)Nelson: Huh. Y'know the way you said that I was expecting an actual mole.Badger: Nope, he's a person.
- Zyuden Sentai Kyoryuger had a Monster of the Week named Debo Hyogakki. He was credited with having wiped out the dinosaurs, but being the first opponent that the team faced, it seemed to be an Informed Ability. Then we got episode 17, where it was revealed that the monsters were getting stronger as Deboss was reviving, to the point where the Kyoryugers started having trouble with the Mooks until they got their Full Potential Upgrade. Then episode 21 subverted it even further by revealing when he was revived that Hyogakki wasn't the only one who wiped out the dinosaurs. He, along with Debo Viruson and Debo Nagareboshi, were a Power Trio known as the Zetsumates, a pun on the Japanese word zetsumetsu, or extinction. Then in episode 25, Hyogakki, as the last of the Zetsumates, showed his true power by making it so that if the people in the city shed a single tear, they'd turn into a Human Popsicle. So while you might have chuckled at his reputation when you first met this guy, it ultimately is revealed that he wasn't nearly as weak as he initially seemed.
- Lemon Demon's Being a Rock Star handily subverts the Rock-Star Song trope. It starts with some generic lyrics about rockstardom, but rapidly switches to insulting the concept in the space of a verse or two.
- P.D.Q. Bach's "Concerto for Horn and Hardart" contains a subversion of the Theme with Variations.
Peter Schickele: The striking thing about the middle movement, the Theme with Variations, is that the variations have nothing whatsoever to do with the theme. Now, that's one of those things that everybody takes for granted, but why not? I mean... This is apparently variations on some other theme. Perhaps we'll turn that other work up someday.
- "A Wonderful Flag-less World" is a song about subverting tropes, and whether constantly subverting every trope makes for an interesting story or not.
- In The Walking Dead:
- Season One subverts the Big Bad trope in Season One with "The Stranger". Halfway through the game, The Protagonist Lee discovers that Clementine, a girl he treats like his daughter, has been communicating with a Mysterious Stranger over her walkie-talkie. This man is implied to know a lot about Lee's group, and holds something against Lee. After an episode of watching Lee's group try and fail to stay alive, he kidnaps Clementine and Lee goes through hell to try and get her back. It's only when Lee and the Stranger meet face to face that he reveals why he hates Lee; at the end of Episode 2, Lee's group stole from an abandoned station wagon, which actually belonged to this man. Because of this, his Wife and child died, and he blames Lee. The man we expected to be the Big Bad turned out to be an Anti-Villain.
- The series as a whole has multiple subversions of the Sadistic Choice, which constantly turns out to be Morton's Fork. Subverted choices include but are not limited to: Saving a young boy or a young man from zombies (the young boy's father always saves him, the young man can't be saved), choosing whether or not to euthanize or attempt to revive an old man who has had a heart attack and may be on the brink of zombifiying (he dies either way), deciding on stealing from an ostensibly abandoned vehicle (if you refuse to steal, the rest of your group steals anyway), and saving an injured man or a woman (an inversion; they both make it).
- In Fallout 4, Elder Arthur Maxson of the East Coast Brotherhood of Steel seems to be set up for being a Puppet King for the Lost Hills Elders back in California. Maxson gained his position at the age of 16, is only 20 years old (which would make him seem inexperienced), and is praised by his followers for bringing his chapter of the Brotherhood "back onto the right path" of following the Brotherhood's Codex. It's also suggested that, since Maxson took control (unwillingly) because of the death of Sarah Lyons in combat, the woman who he had his first crush upon, that he's been indoctrinated by the Elders back out west in order to become a Principles Zealot. However, this trope is subverted in that Maxson actually does wield massive authority and respect among his organization: he is highly charismatic, the members of the Brotherhood love him to a near-fanatical degree, and he is more or less treated like a honorable and mighty warrior king. Also, while he has Taken A Level In Jerkass, he still has a noticeable honorable side; he is actively spreading the Brotherhood's influence not because the Lost Hills Elders are telling him to do it, but because he wants to use the Brotherhood's resources to help people (something that the Lost Hills Elders are not happy about). He also refuses to let go of all of Elder Lyons' reforms (his Brotherhood still recruits Wastelanders, they still protect Wastelanders by annihilating dangerous mutants and A.I.s, and rule fairly (if firmly) over the peoples in the lands they conquer), and still thinks that what he's doing is for the betterment of the human race (even though he takes no pleasure from it).
- Explorers Of Souls: It is a staple of Pokémon Mystery Dungeon games, fanfiction, and comics to make the first Mon the protagonist sees upon awakening their partner for life. Despite what Mel assumes, the Pikachu that she first meets has no interest in adventuring or becoming her compadre.
- George the Dragon subverts the expectations of dragon dietary preferences.
- Blur the Lines subverts Stuffed into the Fridge when Drew receives a present that the giver implies is the head of his lover, Rick. After crying out because he thinks his lover is dead, Rick walks up behind him and says, "What? Why are you screaming?" 
- In Grrl Power, Sydney fumbles for her glasses, talking as if she were Blind Without 'Em. She then takes out the overconfident bad guy and exclaims, "Trope subverted!" before putting her glasses back on and explaining that no one's that blind -- well, yes, some people are, but they don't get to be cops.
- Superman: The Animated Series plays straight and subverts many tropes, but it is noteworthy the way it handled Bury Your Gays. Maggie Sawyer was primarily a victim of Hide Your Lesbians, up until the second season episode Apokolips...Now! there had not been any hints to her orientation in the comics, but she seemed to be legitimately set up for death. When she is attacked by Intergang she is thrown from her car in a fiery explosion and she is shown horribly burned beneath a crushing pile of rubble, noticeably without a blinking eye or moving fingers. It looks like she is Killed Off for Real, especially when Dan Turpin starts calling the attackers "murderers" while screaming at them, except a later scene reveals her to be Not Quite Dead. This later scene, which revealed that she had survived and thus subverted the Bury Your Gays trope, also provided the first ever hint at her sexuality when she is visited in the hospital by a woman that the DVD commentary reveals is Toby Raines, her partner in the comics. So, Maggie not only survives the attack, which is a straight subversion of the Bury Your Gays premise, but the setup actually lead to a (partial) revelation of her sexuality, something this trope is usually invoked specifically to avoid, making it also an inversion.
- The Simpsons is the master of the subverted trope.
Burns: Books and cocoa in the same store? What's next, a talking banana?Smithers: (after a moment of fruitless waiting) Uh, I don't see one, sir.Burns: Of course not. The very notion of a talking banana is absurd. But still....
- One example of many is in the episode "Monty Can't Buy Me Love," where Cue the Flying Pigs is subverted when Mr. Burns and Smithers enter a book store:
- In Vino Veritas is subverted in the episode "Mountain of Madness," where a park ranger enters a cabin and finds it full of partying employees from the nuclear plant.
Ranger: Hey, what is going on here? Who are you people? This is a lookout post. Where is Ranger Mc Fadden?
Drunk: I was just happy to see so many nice people!Ranger: Quiet, you drunk. Where is Ranger McFadden?(The camera then moves a step to the side, revealing a straight-laced ranger with glasses)Ranger McFadden: Right here, sir, behind the drunk.
- A third example, also from "Monty Can't Buy Me Love," is when Mr. Burns, Homer et al have finally found the Loch Ness monster, who proves impossible to subdue. Finally Mr. Burns walks toward the monster with a stern look in his face. We expect an epic fight where Mr. Burns is revealed handing out an unexpected ass-kicking — but instead the scene cuts to the team's helicopter in the air, with Nessie tied up and swinging below. Mr. Burns explains to the admiring team:
Burns: I was a little worried when he swallowed me, but ... well, you saw the rest.
- Another episode subverts the Sheet of Glass example mentioned above. In this case, the car hits the glass, but simply knocks it down flat on the ground and drives over it. The workers then pick the glass back up noting "Wow, tough glass."
- The glass example is subverted again in the episode where Bart gets an elephant. The elephant runs off, stampeding down a street towards two workers carrying a glass pane. They jump out of the way of the elephant, with the glass surviving, only to jump right into the path of a skateboarding Bart... Who they also successfully avoid, eventually making it all the way across the street, glass intact, to complete their goal of throwing it into a dumpster, shattering it to pieces.
- The Simpsons really loves playing subversions for laughs. Another example: When the Simpsons are kicked out of their house, Homer remarks: "Well, at least it's not raining!" Beat. "See, it's not raining."
- Sponge Bob Squarepants is almost as good at doing this as The Simpsons is. In "The Slumber Party", Mr. Krabs enlists the help of SpongeBob to spy on Pearl at the titular slumber party, from which her father has explicitly been forbidden. When the party starts, we see what is obviously SpongeBob dressed as a woman, making no effort to disguise his voice and calling himself "Girly Teengirl from Farawayville." Pearl and her girlfriends call him out on this, and "Girly Teengirl" gets upset and runs off crying...right past a normally-dressed SpongeBob and Mr. Krabs, who wonder who that strange teenage girl was.
- The Ambulance Cut is brilliantly subverted in "Born Again Krabs", when Mr. Krabs discovers a badly burned patty so vile that it tried to bite SpongeBob. Mr. Krabs insists that it's safe to eat, and opens his mouth to take a bite. Immediately cut to a speeding ambulance with the siren blaring...and then cut back to Mr. Krabs, watching it go by and remarking, "Oh look, an ambulance", before he bites into the patty and is instantly rushed to the hospital anyway.
- In Family Guy, Peter has just launched himself from a cannon. Cut to a living room:
Guy: Great, I've got all my dominoes set up exactly how I want them, next to the good china. Now I'll just place this priceless Fabergé egg next to my newborn hemophiliac baby....(Peter lands with thud outside the window, and looks in.)Peter: Wow. Those are all really nice things.
- Clone High:
- Single-Target Sexuality: For most of the show's very short run, Abe is only in love with Cleo and doesn't even notice that Joan is in love with him. But in the end, Abe has the sudden epiphany that he's in love with Joan.
- Whoopi Epiphany Speech: Toots, the blind Jazz player, starts a speech that sounds like it'll be the voice of reason in troubled times, but instead decides to let everyone get on with their angry mob.
- The Hollow: Does this with Big Damn Kiss. Mira and Adam do kiss, but it's extremely awkward and he immediately follows it up by saying that he is not interested in her.
- Total Drama: Does this with Team Mom. Courtney from Killer Bass sees herself as one, but she overdoes it to the point where she's viewed as being obnoxious.