Knights of the Old Republic. Zaalbar on the Star Forge, if Darth Revan forced him to kill Mission with Force Pursuade earlier.
Link from The Legend of Zelda: Ocarina of Time. He pulls the Master Sword out of its pedestal, not knowing Ganondorf was using him to get into the Sacred Realm. Especially hits home when you visit what used to be Hyrule Castle. Link's expression can only be, "Oh my God, I did this."
Mido, the self-established leader of the Kokiri, comes to regret his mistreatment of Link later in life. If Link talks to Mido after defeating Phantom Ganon, he'll ask him to tell Link that he's sorry for the way he treated him, not realizing that he is talking to Link, grown up.
Alexandra Roivas from Eternal Darkness, at the end of the game. After you defeat Pious Augustus, Alexandra finally realizes the ancient god she just released has the power to destroy all of humanity. Shocked, she kneels and says "What have I done!?". The Ancient God is then turned into Sealed Evil in a Can by Edward Roivas' spirit, after replacing two of the runes in the super-mega-huge spellcasting device. Except not really, because it's revealed through one hell of a Mind Screw that Mantorok has orchestrated events so that in three different iterations of reality a different Ancient was summoned each time, essentially meaning that all three were killed at the same time; not being subjected to the same rules of time and existence as us lowly mortals this could easily happen. Of course leaving Mantorok to fester for eternity, plotting his eventual escape.
Funnily enough Dracula himself has a mild one. Following his defeat at the hands of Alucard, he is unable to respond when his son accuses him of sacrificing all he held dear in a bid for power. When he finally ask Alucard what Lisa's last words were all he can do once he hears them is quietly beg for her forgiveness, bid his son farewell, and finally succumb as he's banished yet again.
In Dragon Quest VIII, Dominico is said to be a descendant of one of the seven sages that sealed Rhapthorne away, and indeed, he appears to be a target of the possessed Jessica. However, it turns out that the ACTUAL descendant is Dominico's assistant David (who was Rhapthorne's real target), who Dominico had treated like absolute crap for no reason at all, and Dominico himself was a descendant of the sage's servant. When David is killed by Rhapthorne, who has now possessed Dominico's dog, Sir Leopold, Dominico discovered it had been his duty to protect David, and pulls this trope when he realized he failed that duty miserably.
In the 'good' ending of the demon path in Soul Nomad & the World Eaters, Gig gets the evil slapped out of him and reverts to his prior personality... With the first thing that strikes him is all the gruesome things he has been doing in the meantime.
Taro Namatame in Persona 4 goes through this after being told that he was endangering lives by throwing people into the TVs rather than saving them as he thought. Of course that is if you didn't choose to throw HIM into the TV as an unfair version of the Karmic Death.
Kratos, the protagonist of God Of War, demonstrates this trope upon killing his wife and child while destroying a village; this motivates him to turn against his former master Ares. Whether or not he actually learns from the experience and becomes a better person for it is a matter of debate.
Happens again in God of War II. At the end when he's stabbing Zeus, he accidentally kills Athena. Kratos is distraught by this. Happens again in God of War III when Kratos gets so pissed at Zeus he lets go of Pandora whom he was trying to save from getting destroyed from the flame.
Neku Sakuraba from The World Ends With You, when he realizes that not only was Megumi Kitaniji trying to redeem Shibuya from the fate of Sodom and Gemorrah, defeating him has effectively doomed everyone to die.
Cecil and Kain, after unintentionally helping to destroy the village of Mist, in Final Fantasy IV.
Subverted with another "What have YOU done" in The Elder Scrolls IV Oblivion, when Lucien Lachance reveals that you've been killing the wrong people.
Happens at the very first event of Indigo Prophecy, the main character, after coming to his sense, realized that he is holding a knife, blood dripping from his clothes, and a dead man lying right next to his feet, stabbed many wounds to the chest.
This is a subtext of the game Shadow of the Colossus. Any time the protagonist kills one of the Colossi the death scene is dramatic and sad to drive home the fact that you are the one invading and killing, and the Colossi were living their lives peacefully, bothering no one. Many people felt exactlyMy God, What Have I Done? after they killed the thirteenth Colossus, specifically: a majestic creature that doesn't attack, can barely defend itself, and doesn't even approach the player in any way.
Similar to Shadow of the Colossus, Far Cry 2 seems to be designed to eat away at the player until they realise just how many people they're butchering and what a monster they are, resulting in a My God, What am I doing? moment.
Doubly so if you live in Africa. You watch yourself do all that crap to people in YOUR country with languages YOU understand. It makes playing the game absolute hell.
Kastor in Age Of Mythology, after blindly following Krios's hidden plan of releasing the Titans.
In a more humorous example, in The Nameless Mod, Despot says this when he tells the player that he left Ghandaiah in charge instead of the far more competent King Kashue.
In Jet Force Gemini, King Jeff heads to planet Tawfret to give some more of his people the good news that Mizar's defeat may be at hand... only to see them getting rounded up into slave ships by Mizar's soldiers. He lets his emotions run out of control, and the resulting magical asskicking becomes decidedly not awesome when it zombifies the entire planet and most of the soldiers on it.
Charles Barkley's feelings toward the chaos dunk he performed that killed thousands if not millions and led to the genocide of b-ballers in Barkley, Shut Up and Jam: Gaiden.
The Paragon Caridin in Dragon Age: Origins sacrificed Dwarves to create Golems on the Anvil of the Void. He initially justified this with the increasingly desperate war against the Darkspawn and that he only used volunteers (who were unaware of the sheer agony involved). But when the King (the only one in Dwarven society whose opinion trumps a Paragon's) Jumped Off The Slippery Slope and sent casteless, criminals, and his political rivals to the Anvil and Caridin protested, the King had Caridin turned into a Golem by his own apprentices on the very Anvil he created. After experiencing the "hammer's blow" himself Caridin realized he had done something unforgivable and dedicated himself to ensuring that the Anvil could never be used again.
Can also happen with the Paragon Branka, who led everyone in her house to horrible deaths in the Deep Roads on her mad quest for the Anvil of the Void, and allowed the Darkspawn to rape some of the women and turn them into Broodmothers. If the Warden sides with her during the initial dialogue with Caridin, which leads to being forced to kill him, in the conversation with her after the fight she can be persuaded to see the Anvil for the abomination it is, and to see all of the pain, suffering, and damage her maniacal desire for it has caused. If successful, it will cause her being so overcome with guilt that it drives her to commit suicide by leaping into the lava.
Adrienne in Phantasmagoria didn't actually say the line, but her "What have I done?" moment happened when she realized that Don's possession was the direct result of her opening Carno's Magic Book and releasing the Demon at the beginning of the game. Oops.
In Mass Effect 2, Mordin Solus was left guilt-ridden by his work in updating the Genophage to ensure that the Krogans maintain the same rate of reproduction. While he felt that what he did was necessary, it didn't mean he had to like it and forced himself to make anual trips to check on it since he felt that simply walking away would be wrong. In order to better atone, he became a doctor/borderline vigilante in the Omega space station.
Subverted, however: he says repeatedly that he would choose to do the same thing, and that he doesn't regret what he did. He felt it was necessary; however, he chooses to always remind himself of the price paid. But it's played straight in Mass Effect 3, where he comes to fully regret working on the genophage and decides to help cure it.
Two other Salarians involved in the project, Maelon Heplorn from the second game and Padok Wiks from the third, both eventually come to the conclusion that their work was unethical. Unfortunately, the former ends up falling even further down the slippery slope when he tries to reverse his handiwork.
Gavin Archer from the "Project Overlord" Dl C eventually has this reaction to the experiments he did on his brother, to the point where he ends up quitting Cerberus because of it.
In Mass Effect 3, if you can make the Illusive Man realize that he's being indoctrinated by the Reapers, he'll shoot himself in the head.
Miranda Lawson is an interesting variation as her's is more, "My god, what did I ALMOST do?" Her hatred of her father comes from the fact that he tried to control her and her sister, make them slaves to do whatever he wanted them to do. She almost did this to Shepard, when she attempted to plant a control chip into his/her brain while bringing him/her back to life. By Mass Effect 3, she realizes this and feels unbearable guilt, telling Shepard how sorry she is for even considering it.
A close variant of this phrase serves as the opening tagline of Dark Fall: The Journal.
Admiral DuGalle, after he is tricked by Lt. Duran into killing his old friend Vice-Admiral Stukov, who reveals that Duran is a traitor with his dying words. DuGalle's guilt over this later leads him to commit suicide after the Zerg have obliterated the UED forces.
In World of WarcraftCataclysm, Garrosh Hellscream has this reaction after realizing that Magatha Grimtotem had poisoned his blade, and that by killing Cairne, he played right into her plans.
Super Metroid even has a few of these moments. After fighting a big Metroid, it runs off in shame once it realizes Samus is it's adoptive mother from the start of the game.
Happens again the Crocomire, who suffers a nasty death hardly fitting it that can only make the player feel sorry for it. (It spends a good 10 seconds having its skin melted off in acid). Honestly, even the game designers felt the moment was worth a What the Hell, Hero?.
In Assassins Creed II, some of the lieutenants of Savonarola have this reaction after Ezio fatally wounds them.
Ryoji does this while explaining the Fall to S.E.E.S. in Persona 3, although in his case it's less "My God What Have I Done" than "My God What Am I Going To Do?"
Star Ocean 4: In the past Earth, Edge hands an energy source equal in power to a doomsday device to Earth military so they can prevent the future disaster which befalls Earth. This backfires.
At the end of Etna Mode in DisgaeaAfternoonOfDarkness, Etna recovers the memories that Maederas stole from her, and the very first one that returns is her promise to King Kricheveskoy, the only person she's ever trusted and looked up to, to protect his son Laharl. This being Etna Mode, Etna's already killed Laharl. A Not-So-Heroic BSOD ensues.
Anders has this reaction in Dragon Age II right after he blows up the Chantry and sparks open conflict between Mages and Templars if he is a full rival. After the most recent patch, he can even be convinced to side with the Templars after realizing that he has pretty much become a true abomination to help mitigate the damage to Kirkwall.
In Tactics Ogre, some of the leaders' death quotes might invoke this to the player. You kill a person who seems to just be a named Mook...then an optional battle (If you wanna recruit one of the characters) has a woman who wants revenge because you killed her husband. After you beat her, she reveals she's pregnant. Another person laments that he won't be able to get medicine for his sick daughter.
The PSP version also has a wizard who fights you in chapter two who wants revenge on Denam. What for? A boss you fought in chapter one was his twin brother.
And in the game before that, The Lost Age, The Final Boss the heroes killed turns out to be Isaac's father and Felix and Jenna's parents. This causes Jenna to have a complete emotional breakdown, knowing that not only her parents are going to die soon, but she was the one who did the horrible deed. To be fair, the Wise One did this trick to test the resolve of the heroes and the Golden Sun event winds up reviving the parents. Even then, Jenna is still shaken up by the whole ordeal.
In Tales Of Symphonia, Yggdrasil has a BSOD of the none-heroic variety when Martel asks him this very question.
Also, in Tales Of The Abyss, when Luke realizes he's been tricked into murdering hundreds of thousands of innocent people. Pretty much the rest of the game is affected by this moment.
A pretty common tradition in the Tales series it seems, as Tales Of Vesperia has Estelle do this after driving Belius mad by healing her. It takes another character's self-muliation to drive her back into reality.
Emil has one in Tales of Symphonia: Dawn of the New World in a skit after The Reveal that he's really an amnesiac Ratatosk and that he's been using Marta as bait the entire time. Tenebrae talks him out of it though.
In Catherine, girlfriend Katherine suffers from this after the incident on day 8, frozen in place screaming.
Lara Croft in Tomb Raider Anniversary has this moment when she is forced to kill Larson, who held her at gunpoint. It was Lara's first human kill in her whole life.
And again in Tomb Raider 2013. Lara's first human kill occurs when defending herself against what's very strongly implied to be a rape attempt by a Mook.
Tyrann in NieR goes through this in Endings C & D over his possession and corruption of Kaine. It motivates him to do a Heroic Sacrifice for her.
In the Fallout New Vegas DLC Old World Blues, it's possible to get Evilutionary Biologist Dr. Borous to feel intense guilt over his brutal experimentation of his loyal dog Gabe after you bring him his food dish. Of course, he quickly forces himself to suppress the feeling and goes back to his obsession with Science!
The Sacrifice comic for the video game Left 4 Dead shows Zoey having this moment when she realizes what she did back home after the infection spread. While Zoey was visiting her parents at home, a common infected wanders into the room and attacks Zoey's mother, infecting her. Shortly after, her mother turns and attacks her father, forcing him to kill her. Believing that he is infected, Zoey's father asks her to kill him so that he won't turn. It isn't until 2 weeks later after she and her other survivor friends get taken by the military that she learns that her father wasn't going to turn at all, due to having a gene that makes them a carrier but immune, which she has inherited as well.