In general a popular comic trend in recent years has been to subject female villains to this as a way of compensating for the general scarcity of female superheroes. DC has been especially enthusiastic about revamping their back catalog of villainesses (Harley Quinn is a particularly notable example), but Marvel isn't too far behind the trend.
The Age of Apocalypse inverted the moral alignments of several long-running X-Men characters, and more than a few of them were villains:
First and foremost was Magneto, who in the comics has been the X-Men's oldest Arch-Enemy. In his universe, he is in fact the X-Men's founder, having organized and named them in memory of his fallen friend Charles Xavier. And in filling Xavier's shoes, he's the closest thing the heroes of this universe have to a Big Good. He also has a much healthier relationship with his children, Scarlet Witch and Quicksilver, whereas his Earth-616 counterpart is generally known to be a pretty terrible father.
Another very prominent X-villain to get a moral shift was Sabretooth, number one Arch-Enemy to Wolverine and one of the X-Men's most bloodthirsty foes. In this continuity Creed starts out similarly to his 616 counterpart, but quickly decides that Apocalypse's Omnicidal Maniac goals are Not What I Signed on For. This steers him towards Anti-Hero territory, but he acquires true heroism through his relationship with Blink, a teleporting mutant who comes to see him as a father figure. This version of Creed ended up being one of the most popular of the AoA characters, so much so that he was brought back (along with Blink) to be a main character in the Exiles title.
Magneto's disciple Exodus also received an alignment switch as a direct result of his mentor's adaptational heroism. While the 616 Exodus was radicalized into being a Super Supremacist by Magneto, this Exodus is much more accepting of both humans and mutants, as well as being more kind and less prone to Kick the Son of a Bitch. Came with a Redemption Demotion in his case though, as this Magneto deliberately keeps Exodus from knowing his true potential as a Superpower Lottery winner and even affixed Power Limiter devices to him to keep him from being corrupted by his own powers.
Classic X-Men baddies Mastermind, Sauron, and Toad became heroic members of Forge's Outcasts, an independent La Résistance group that came across Nate Grey the X-Man and adopted him.
Receiving this must be In the Blood in the Age of Apocalypse, because Sabretooth's son Graydon Creed also got a taste of this. Rather than being a Fantastic Racist and aspiring President Evil, he's the deeply troubled but heroic resistance fighter Horror Show. He's so heroic, in fact, that he even becomes the lover of Jean Grey!
Inverted with Abyss. Originally created as an Original Generation member of AoA Apocalypse's Four Horsemen, he proved popular enough to get adapted into the regular 616 continuity. But since 616 Earth isn't a Crapsack World, Abyss was reimagined as a hero.
The 2011 storyline Age of X accomplished this for 90's X-Men baddies Frenzy and Unuscione, with particular emphasis on the former. A pair of villainesses hailing from Magneto's Acolytes, these two ladies were about as evil as evil came — Unuscione Would Hurt a Child even if that child was a developmentally disabled member of her own race (and terrorized a school bus of human children while doing it), while Cargill was a true believer that Murder Is the Best Solution and remorselessly killed off X-Men supporting character Sharon Freidlander. But thanks to this storyline's giving them a chance to find out that Good Feels Good, the duo turned their backs on supervillainy afterward, with Frenzy even going so far as to join the X-Men (Unuscione has since relapsed into supervillainy, but spent a good few years trying to live a normal life before the inevitable reset button push).
The Eternals: One of the most prominent Eternals is the fashion model and occasional member of The Avengers Sersi, who is in Marvel continuity the same person as Circe (the evil sorceress who turned Odysseus' men into swine in The Odyssey). In her backstory, it was clear that Homer distorted the facts quite a bit; yeah, she turned them into pigs, but to make a long story short, they started it.)
One of the main characters of the team throughout the book's run is a version of Mimic, the original Sixth Ranger turned Sixth Ranger Traitor of the X-Men who in the original timeline spends his time in a decades-long HeelFace Revolving Door. This Mimic never experienced any such moral lapses, and to highlight his heroism, he's even drawn more attractively than the 616 Mimic, having a very clean-cut all-American look while 616 Mimic often looks like nothing so much as a winged hobo.
A straighter example is the UXM adaptation of Emma Frost. 616 Emma started out as a sadistic Rich Bitch whose evil deeds made her the X-Men's preeminent villainess before her HeelFace Turn in the '90s and decades-long redemption arc (and thanks to her abusiverelationship with Cyclops, even at the end her redemption is questionable). This Emma, on the other hand, is infinitely less sadistic, is in fact an Actual Pacifist, and never engages in any kind of mind games or intimate psychic tampering like 616 Emma did with/to Scott. The result is an unambiguously heroic Emma who, sadly, was among the hundreds of UXM characters pointlessly killed off in the shock-for-shocks-sake event Ultimatum.
UXM's adaptation of Pyro started out as one of these, being a much more sympathetic character who was a Minion with an F in Evil and even joined the X-Men after proving his new heroism by helping other mutants. Unfortunately, while Pyro survived the events of Ultimatum, a Fate Worse than Death at the hands of writers awaited him when during Ultimatum 3 he experienced steepAdaptational Jerkass and transformed from a decent guy into a leering wannabe-rapist, something 616 Pyro wasn't even at his worst. Mercifully, he was Killed Off for Real shortly after.
Genocidal Social DarwinistApocalypse is reinvented into a Well-Intentioned Extremist and outright Big Good who has been putting the X-Men through Training from Hell to prepare them for the threat of a cosmic Fantastic Racist Celestial on its way to Earth. While Apocalypse has occasionally been presented before as having Well-Intentioned Extremist leanings, this is the only interpretation of the character to date which has tipped over into outright heroism. Note that the series is a direct sequel to the 1992 X-Men animated series, where Apocalypse is even worse than his traditional depiction! Apparently, it was all an act for when the heroes had to face someone who really was everything Apocalypse was only pretending to be.
Cassandra Nova is also more idealistic and noble than her comic counterpart even being an ally to this version of Apocalypse.
Joseph is depicted in his original 90's characterization as a hero, while the mainstream version has since undergone a (rather forced) FaceHeel Turn.
Batman rogue Mr. Freeze was originally a very generic, pun-spouting villain in a green welder's suit. Then Paul Dini got ahold of the character and gave him a total overhaul for his appearance in Batman: The Animated Series, bestowing upon him his now-iconic name, look, and Tragic Villain backstory. Taking note of this, the comics revamped Freeze completely to hew to Dini's interpretation of him.
In the Batman '66 comics continuity, Harley Quinn is an idealistic psychiatrist who voluntarily sacrifices her sanity to sabotage a mind-bending ray that the Joker is using to drive Gotham City insane.
In Batman: Earth One, Killer Croc is a man who hid in the sewers after escaping the circus and ends up joining Batman's inner circle after helping stop the Riddler, a far cry from the Dumb Muscle of the mainstream comics. In a similar vein, Killer Croc was also portrayed as being much kinder than he usually is in Gotham Academy as a result of his contact with Sybil Silverlock, the protagonist's mother during his stay at Arkham. He even saves Olive from a burning building with her friends declaring him a hero. Unfortunately for him, he's committed several murders prior to this change of heart, leading Batman to hunt him relentlessly.
Batman villain Basil Karlo, aka the first (and briefly 'Ultimate' Clayface) has for decades been by far the most reprehensible and villainous of the Clayfaces. Later Clayfaces Preston Payne (aka Clayface III) and especially Matt Hagen (Clayface II, but much better known for his sympathetic portrayal as the first Clayface of Batman: The Animated Series) were portrayed more sympathetically and laid the groundwork for the concept of Clayface as a Tragic Villain, which the comics took shameless advantage of to reboot Karlo's character. Instead of being an unrepentant narcissist and egomaniac, Karlo is now a Minion with an F in Evil who decides that Being Evil Sucks so much that he agrees to join the Batfamily and toe Batman's line 100% if it means maybe getting a cure for his Power Incontinence. While this new Karlo is a much more likable character, he doesn't jive at all with the Karlo readers have known for decades.
Kyodai Ken was created for Batman: The Animated Series as a villain with ties to Bruce, having trained with him until Ken was caught stealing and kicked out of the dojo and blaming Bruce for the consequences of his own actions. Detective Comics (Rebirth) sees him as a loyal bodyguard of one of Bruce's teacher.
Veronica Cale is still a villain who's done some awful things, but whereas the original was motivated purely by envy, this one is motivated by her desire to have her daughter back, and is basically a Cosmic Plaything.
Poison Ivy and Two-Face are completely heroic, and Harley Quinn and Killer Croc have disreputable backgrounds but are more sympathetic than their main-continuity versions.
Yuki and Yuri, the Katsura sisters, are a pair of Batgirl (2011) villains in the main continuity. Here, however, they're part of Donna Troy's group of rebels who fight against the unjust internment of Japanese-Americans.
Talia al Ghul fights alongside the heroes, and protects the Lazarus Pit from evildoers like Black Adam.
Cheetah still starts off as a villain, but eventually seeks redemption after realizing the horrors she's committed.
Trigon is depicted as a nature spirit who genuinely loved Raven's mother, instead of a demon who, Depending on the Writer, either callously seduced or brutally raped her. Subverted as he ends up on the side of evil in the end.
In Gotham City Garage, Harley Quinn, Catwoman and Silver Banshee are more heroic than their villainous canon counterparts, risking themselves to overthrow a tyrant.
In the classic Legion of Super-Heroes, Mano of the Fatal Five had a bit of a Freudian Excuse in that he was subjected to prejudice on his home planet, before he destroyed it. In the Reboot Legion, he destroys his planet after everyone on it was killed by weapons sold by MacCauley Industries, and then seeks revenge on Leyland MacCauley. When he realises the rest of the Five are a bunch of psychos who like destroying planets, he turns against them. He later rejoins the group, but still tries to avoid harming innocents.
Batman Annual: Ironically enough, averted with Mr. Freeze, who experiences this trope's inverse instead for his New 52 interpretation.
Justice League of America: Arthur Light, better known as Dr. Light, was a third-string baddie and punching bag of the Teen Titans (who had a rape retconned into his backstory in an attempt to make him more evil) pre-New 52. Now he's a supporting member of the titular Justice League and he died a hero.
Starfire's sister Komand'r (aka Blackfire) was cruel, sadistic and treacherous in the former continuities. Now, despite having had some questionable attitudes toward Kory, she's still a better person than her previous version, and eventually makes peace with her sister, as seen in Red Hood and the Outlaws, where Kom and Kory share a hug. To be fair, the New 52 wasn't solely responsible for this shift - Kom's redemption first started in the 2009 L.E.G.I.O.N. (DC Comics) sequel series R.E.B.E.L.S, where the previously one-note villainess was depicted as a more complex figure with positive as well as negative traits. The New 52 simply picked up where R.E.B.E.L.S. left off.
In the Supergirl (2011) stories, the villainess Silver Banshee was turned into a troubled but clearly heroic young woman, whose first appearance has her jumping in front of Kara to stop soldiers shooting her. Later issues have hinted that she's having trouble keeping her superpowers (inherited from her evil father) under control but even here the implication is she is heading towards being a Tragic Villain rather than the totally unsympathetic character she used to be.
Wonder Woman's oft nemesis Ares had traditionally been a straight villain, and even when he wasn't he was never a nice guy, he's powered by war and bloodshed after all. The New 25 version is probably the closest to being a hero out of the entire Greek pantheon and is painted as Diana's mentor and grandfather figure—amusing since he is her grandfather even if the writers ignore this in favor of his new status as her brother since this version of Wondy has a father, and that father is Zeus. note For the confused Zeus is Ares' father, Ares is Hippolyta's father, and Hippolyta is Wonder Woman's mother. In this continuity Hippolyta slept with her own grandfather which resulted in her pregnancy with Diana.
In Wonder Woman (2006) Achilles is trying his hardest to be a hero in the modern sense of the word, and has little in common with the narcissistic Straw Nihilist of the original myths. It might have something to do with his new heart, which came from a selfless and compassionate god (whom Zeus murdered).
The graphic novel depicts Harley Quinn as a straight up heroic figure fighting against an oppressive establishment. In a very notable departure, she ends up opposing The Joker and tries to stop him after he endangers innocent people, and the book ends with her preparing to hunt him down.
The book's version of Poison Ivy (renamed "Ivy Du-Barry") is still an environmentalist, but not a violently militant one. She also seems to care about a broad range of social justice topics instead of just the environment, as opposed to he classic comic counterpart, who would just as soon Kill All Humans if it meant protecting the Earth's plants.
The Archie Comics-published Mega Man comics do this with the Robot Masters from the original game, with Mega Man's attempts to talk them out of following Wily's orders convinces them to help him, and later join and serve his supporting cast when Wily's programming to them is undone, though this is more because they were already Dr. Light's robots to begin with. This trope rings truer when half of the Mega Man 2 and Mega Man 3 Robot Masters pull a HeelFace Turn.
Mad Madame Mim from Disney's The Sword in the Stone was a genuinely villainous character who tried to kill Arthur because, as she made no effort in hiding, she's evil. In the Disney comics that later featured her, she was more of a harmless witch or occasionally even a heroic one.
The Decepticons downplay this, as they were formed as a protest group against the corrupt government, before devolving past He Who Fights Monsters and becoming even worse (even the government thugs got hired into their group).
Most of the Scavengers are villains outside of The Transformers: More Than Meets the Eye, with the exceptions of Grimlock, who's an Autobot, and Fulcrum and Nickel, who are original to MTMTE. Even at the start of their career in the Hasbroverse, they're less "villains" and more "bums", and eventually they commit to doing good full-time...at least when they can afford to.
Megatron and his three main lieutenants underwent this. Megatron's reasoning for starting the war, over throwing the caste system, are more sympathetic and ultimately he pulls a HeelFace Turn and becomes an Autobot. Shockwave was a senator who campaigned for a more equal society before the corrupt leaders reprogrammed his mind to lack empathy and even then he snapped out of that and performed a Heroic Sacrifice. Soundwave received a more sympathetic play as an outlier and in the present has made a HeelFace Turn to become one of Optimus's main allies in his quest for peace. Starscream, while still played as the least ethical, ultimately does receive more of a sympathetic edge as he becomes a Byronic Hero who is at least trying to help Cybertron.
Knock Out and Breakdown were Decepticons in Transformers: Prime; Knock Out defected for pragmatic reasons, and Breakdown died a Decepticon. In The Transformers: Till All Are One, Knock Out and an unnamed bot with Breakdown's designnote they already had a Breakdown in the comic are instead a married couple who hail from the unaligned world of Velocitron, which has a speed obsession. Knock Out is still a vain jerk, but he's a vain jerk who's willing to relocate from his home to Cybertron because his less speedy husband is happier there, and "Breakdown" doesn't do anything villainous at all - a considerable improvement on the "Mad Doctor" and "murderous thug" characterisations they received in Prime, and ones that probably leave them higher up the Karma Meter than several fully-qualified Autobots, such as Prowl, Getaway and Whirl.
Rio is no longer exceedingly jealous like he was in the cartoon. He's also firmly just dating Jerrica, and is pissed off when she forgets herself and kisses him as Jem.
Jetta lost a lot of her attitude towards her bandmates. In the cartoon she went as far as to try and scam Pizzazz out of millions, and she was always fighting with Roxy. In the comic Roxy and Jetta are friends and Jetta gets along better with the others.
The comics have tried to humanize Pizzazz more. While she still frequently throws fits over little things she has Hidden Depths and cares for business.
Overall The Misfits are portrayed more realistically. In the cartoon they casually would do stuff that would end them in jail or with restraining orders. In the comics they don't attempt to physically harm the titular band or crash random events.
Lady Death was originally conceived as a villain protagonist whose end goal was the complete destruction of mankind due to a curse placed on her by Satan that she could not return to Earth as long as humans walked on it. Subsequent re-imaginings and interpretations of the character made her more traditionally heroic or tried to. In the Avatar Press/Boundless continuity, she serves as guardian and protector of the Labyrinth even if she could be a nasty about it.
Muppet King Arthur gives this treatment to King Arthur's Evil Nephew Mordred (portrayed by Kermit's nephew Robin), who coerces his uncle into surrendering his kingdom solely to see if his uncle is truly worthy of the throne and commends his uncle for proving that he deserves to be king by being willing to put his people above himself.
In Noob, Gaea negotiated for her guildmates' (except Omega Zell) immunity from Tenshirock's "attacks" as part of her frequent cooperation with him. The webseries and novel storylines have that immunity be Tenshirock's personal initiative while the nicest things Gaea ever said or did fell into Jerk with a Heart of Jerk.