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." What makes this moment especially heartwrenching is that Link is technically still a 10 year old boy.
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.
Princess Hilda, Zelda's alternate universe counterpart in The Legend of Zelda: A Link Between Worlds, when she is confronted with the fact that she started exactly the chaos that her ancestors were trying to prevent.
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.
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.
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" DLC 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. Actually a Continuity Nod to the first game, where you can invoke the same on Saren.
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 its 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 Assassin's 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 Disgaea: Afternoon Of Darkness, 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 non-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.
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!Unless you go and take his side during the first conversation, like Gabe would have. If so, in the latter conversation he'll have a much bigger guilt-trip, and vouch for you when the time comes, to give you "the life Gabe never had".
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.
Resident Evil 5 has this for Jill Valentine, who is brainwashed by Wesker via a device attached to her chest. After Chris and Sheva remove the device, Jill regains her senses and tells the duo that she was fully aware of what she was doing, but she had no control over herself, realizing that she could have killed them and was also responsible for everything she did under Wesker's control. Jill asks for forgiveness, to which Chris and Sheva happily accept.
This happens for Master Asia in Shin Super Robot Wars. Master Asia first met Domon when he was building the Devil Gundam with Professor Kasshu, and immediately felt an overwhelming sense of warrior kinship. To test Domon's potential, he began the enjoyable process of training him, realizing too late that Domon proved that not all humans were dangerous. But it was too late to prevent the completion of the Devil Gundam, which sadly took Kyouji prisoner and even survived its plunge to Earth. Then the Balmar arrived, and Master Asia saw little chance of escape or of mankind surviving. But then he realized he could use the Devil Gundam to blow away one or two of the enemy ships, and has been working hard at that ever since. But he realized another mistake: Earthlings are far more resilient than he expected. For this grave error and all the trouble stemming from it, he would normally offer his life as an apology to Domon on the spot.
The Last of Us provides a particularly heart wrenching example with brothers Henry and Sam. After escaping Pittsburgh, it is revealed that Sam was hiding a bite from the rest of the group. When Ellie is prompted by Henry to wake him, she is attacked, barely managing to hold him off before Henry puts him to rest. Henry proceeds to say to himself "Henry, what have you done?" On the verge of tears, he directs his handgun in Joel's direction before screaming "It's all your fault!" Rather than shoot Joel, however, he instead raises the handgun to his temple and pulls the trigger.
Legacy of Kain provides a big one in Blood Omen 1 when Kain travels back in time to kill William the just before he goes corrupt. The villain uses this in the present to start a genocide against vampire kind, sparking this trope
Also Soul Reaver 2 when Kain stops the reaver from absorbing Raziel's soul, which was exactly what the villains wanted.
A frighteningly effective one in Far Cry 3: protagonist Jason is undercover in the crew of pirates, murderers and mercenaries of the Big Bad, and he gets a mission to torture the crap out of a prisoner. He goes to do so and finds out that it's his brother Riley, who he previously thought dead. After a very brief attempt at explanation, he then beats the crap out of the prisoner, and shoves his thumb into a gunshot wound, causing excrutiating pain. The result? Jason looks at his hands, covered in his brother's blood, and says "What have I become?" After spending most of the game on a revenge-fueled murder spree, it's almost disturbingly sobering.
In Deus Ex: Human Revolution, by using the Social Enhancer augment on Hugh Darrow in Panchaea, you can get him to realize that the true reason why he wants to destroy the augmentation technology is jealousy: he is one of the few people genetically incompatible with it, so he can not use it to fix his crippled leg — the reason why he invented it in the first place.