Kimba the White Lion: After his father's death, he must reclaim his kingdom. However he will have to reclaim it from a black-maned, scarred lion has usurped the throne in his absence. It must be told it was made forty years before Disney made The Lion King.
The manga adaptation of The Legend of Zelda: A Link to the Past by Himeakawa ends this way, with the return of the missing Princess Zelda (who is immediately crowned Queen, thus making it the Rightful Queen Returns).
Twisted in One Piece: the rightful king of Dressrosa, Donquixote Doflamingo, returns after another bloodline has ruled his kingdom for eight hundred years. However, that other dynasty was a kind and pacifistic one, while the "rightful" king, as his family, is evil.
Also inverted by the rightful King of Drum, a tyrant that ruined the kingdom and abandoned it after a pirate attack. The kingdom actually got better without him in charge, and Drum's people were terrified by the idea of the King's return.
In the follow-up comic book Farscape, Rygel is contacted by his remaining wife, who tells him that his cousin Bishan, who deposed Rygel and made himself Dominar decades before, has grown quite unpopular among the people and the aristocracy. She urges Rygel to return to Hyneria to lay claim to his rightful throne, telling him that the people will support his claim. However, this turns out to be a trap. Bishan captures Rygel and imprisons him along with several of Rygel's supporters. In the end, Rygel shows that the long exile has changed him for the better, and he leads an escape and captures Bishan. Rygel resumes his position as Dominar Rygel XVI of the Hynerian Empire.
Subverted in Shrek the Third: Shrek is himself a rightful heir (through his wife, Princess Fiona), but he intentionally embarks on a quest to find another rightful heir — the king's nephew, Arthur Pendragon — to relieve himself of the duty.
In Disney's Robin Hood, everyone (except for Prince John) desperately waited for King Richard to return and reclaim his throne from his greedy brother.
King Ralph: After a rather ridiculous accident during a mass family photo shoot toasts almost every member of British Royalty, the call goes out to find anyone with the right blood line. The first heir left in line is Ralph -but he doesn't like the job.
Thor, the rightful heir, in his titular movie—then zig-zagged when Odin wakes back up.
In many versions of the Robin Hood legend, the tale ends with Richard The Lionheart returning from the Crusades, ousting his greedy brother Prince John and knighting Robin of Locksley. The original Robin Hood didn't have this for centuries. But Robin was written into Ivanhoe as a supporting character, and most adaptations since have followed suit. The setting of the original legend could be a generation or two either side of the Lionheart's reign.
The main plot of The Hobbit is Thorin Oakenshield's quest to reclaim his ancestral kingdom of the Lonely Mountain by killing Smaug, the dragon who has laid the Mountain and the neighboring city of Dale to waste. Eventually, the Mountain is retaken by the dwarves under a new King Under the Mountain, initiating a prosperous era for the dwarfs and their neighbors, even though Thorin has died in battle, and the new rightful king is his cousin Dain. The motif is echoed within the same book by the dragonslayer Bard, who, as a descendant of the royal house of Dale, re-establishes the ruined city after Smaug's death.
Aragorn of The Lord of the Rings is the rightful heir to the kingdoms of Arnor and Gondor, of which the former is defunct and the latter is ruled by stewards after the line of kings has died out. At the end of the third book, aptly titled The Return of the King, he is crowned king of Gondor and later (as told in the appendices) restores the kingdom of Arnor.
The Lord of the Rings also mentions that the dwarves of the house of Durin believe their first king Durin periodically returns to his people as a reincarnation born into the royal line.
King Arthur, of course. As a boy, he came back once, and later in life he was mortally wounded ... but it's also said he'll come backfrom the dead at his kingdom's hour of greatest need.
Subverted by Carrot Ironfoundersson in Ankh-Morpork. He's the rightful king, and would make a really good one, too, caring about both his people and the city... but he stays away from the throne for exactly that reason, as he knows that monarchy is exactly what Ankh-Morpork doesn't need, and possibly because he ascribes to Vimes' problem with the term 'rightful'. He'll occasionally exploit his status, though, using it to pull off the narrative tricks that come with this trope, such as fighting other enemies aware of narrative causality who realize you can't beat a rightful king who's not yet on the throne, especially when he's got justice and is outnumbered. He once very politely asked Vetinari if he would do him a favor, and grant Vimes noble rank.
He often directly subverts the Tolkien examples, with the Patrician of Ankh-Morpork being in the role of the Steward of Gondor. Unlike the Tolkien example, both the Steward and the Rightful King are happy with the status quo: Vetinari can rest secure in the knowledge that, if anyone DOES try to organize a coup to restore the Rightful Heir to the throne, they haven't got the correct Heir. Meanwhile, the heir knows the city is being taken care of by the right man for the job.
Pratchett does the same trick in Wyrd Sisters in which Tomjon returns to Lancre, but rejects the kingship in favour of being an actor. Luckily he has a secret half-brother. Said half-brother is the son of the former King's jester; Tomjon is the illegimate son of the queen and the jester. Or at least that's what the good folk of Lancre believe, and since there's no such thing as paternity tests on the Disc there's no way to disprove it. Word of God is silent on the matter as yet. Draws on Macbeth
The Prisoner of Zenda is almost a subversion of the trope though since the guy helping to restore the king is agreed by the king's allies to actually be a better ruler, and in fact the guy who overthrew the king is also a much better ruler.
Subverted in the novel The Dragons Of Babel by Michael Swanwick. The king of Babel has been missing for a few decades. Will, the protagonist, falls in with a con man named Nat, who comes up with a plan to pass off Will as the king's bastard son and therefore the sole heir to the throne. In the end, it becomes a Double Subversion: Nat is both the long-lost king and Will's biological father, meaning that Will really is the heir to the throne.
Prince Caspian: His father ruled until slain by his uncle Miraz. Miraz considered Caspian a suitable heir -until his own son was born. Caspian had to flee, but Aslan had decided that Caspian should be on the throne.
Not just the eponymous hero, either. All four Pevensie kids were the rightful rulers of Narnia before they got suckered into going back to being boring kids again.
Also in The Horse and His Boy. In this case the good King of Archenland is still alive and well, but his son and heir, Corin, has gone missing. As has his older son and real heir, Cor, who is actually Shasta.
The Belgariad. If you can't figure out who it is, you need to read it some more. He's the one that gets the big honking sword partway through.
Played with in Lloyd Alexander's Chronicles of Prydain. The country has a bunch of lesser kings who are overseen by one High King, and although throughout the series there is a kindly and just man in this position, the oracular Book of Three foretells the coming of a truly great High King. There is also an evil overlord threatening the land. The series follows the adventures of a foundling child, who is rescued by a great wizard and is raised by him out in the middle of nowhere.
There is a twist, however, which takes center stage beginning with book 4. Taran goes questing in search of his origins, receives offers of adoption from kings and commoners both, and finally realizes he should just be himself. In book 5, he finds out he was orphaned in one of Prydain's many wars, and even Dallben doesn't know who his parents were.
Subverted in the A Wizard in Rhyme series by Christopher Stasheff. One of the characters is the directly descended heir to his universe's equivalent of Charlemagne, and technically the rightful ruler of about half a dozen countries. However, he has vowed only to reveal himself if things get so screwed up that they can't be fixed any other way, and he works behind the scenes to make sure that doesn't happen.
In John Barnes's One for the Morning Glory, Princess Calliope returns to her native Overhill, which the usurper Waldo had seized when she was a child, and is crowned there. A Fisher King effect comes into play.
Subverted in Ranger's Apprentice. When Halt, who is the rightful inheritor of the throne of Clonmel, returns to his kingdom, it is only to convince the king to stand up against an evil cult which threatens the kingdom. When it becomes clear that the king is in no way interested in helping his people, Halt briefly impersonates the king rather than deposing him, even though he had enough local support, as well as the right, to have carried it off.
In the Chivalric RomanceHavelock, Havelock is living in menial disguise in England when Princess Goldborough's guardian decides he can marry them off and keep her from the throne. After, Havelock returns to Denmark to reclaim his throne, and with the army he acquires there, returns to England to reclaim the throne for Goldborough.
Princess Ozma, the true ruler of Oz in L. Frank Baum's series of books, is restored to her throne some time after Dorothy's original adventure; by the time Dorothy returns to Oz in the third book in the series, Ozma's back on her throne and ruling wisely and peacefully. Although the second book in the series details Ozma's recovery (she had been usurped by the Wizard and the wicked Witches and disguised as a boy for her entire life, so that even she didn't know who she was), Baum changed her origin story no less than three times during the writing of the rest of the series. Note that Ozma rules as anointed sovereign, but usually is not addressed as Queen; you know why. However, at the end of The Land of Oz, Ozma is referred to as a "Queen."
Jim Butcher's Codex Alera series used this. Due to a Contrived Coincidence, it was literally the case that the earth shook and the sky turned red when the long-lost prince declared his true identity publicly.
In the Prince Roger series the titular prince's return, following an assassination attempt on him as part of a successful coup against his mother the Empress, provides the spark to trigger a counter-coup, and regain control of the Empire of Man.
In the Conan story The Hour of the Dragon, "Valerius, rightful heir of the throne of Aquilonia." wants this — to depose Conan. Doesn't work as usual. For one thing, Conan sets out to implement this trope.
As does "The Scarlet Citadel," where Conan escapes the title dungeon with the help of a freed sorcerer and takes back his throne from Puppet King Arpello.
Inverted in the Fighting FantasygamebookBlack Vein Prophecy: as it turns out, both the protagonist and main antagonist are the sons of the former king of the Isles of the Dawn. However, much of the book ends up proving that the protagonist will make a good king despite being descended from the previous ruler. Also, in the best ending, your first act upon becoming the king is to institute an elected parliament.
The whole point of Jesus' second coming in the Left Behind book series.
Purposefully subverted in Mercedes Lackey's The Lark and the Wren; the old king had driven the country to the point of rebellion, the usurper is doing an excellent job, and the rightful heir only comes back to publicly renounce the throne, having neither the training nor the inclination to run a country.
"Politicians do not understand much; but politicians do understand politics," said Pond pensively. "I mean they do understand the IMMEDIATE effect on mobs and movements. Somehow he had slipped in and started a campaign of private popularity before they even knew who he was. When once he was popular, they were helpless. How could they say: 'Yes, he is popular, he is on the side of the people and the poor; the young men accept his leadership; but he is the King and therefore he must go'? They know how horribly near the world is to answering: 'Yes; he is the King and, by God, he shall stay.'"
Deconstructed in A Song of Ice and Fire. Several of the claimants to the Iron Throne see themselves as this (Stannis is the rightful heir of the former King Robert who claimed his throne by conquest; Viserys and Daenerys are the children of the king before Robert, Aerys Targaryen, and the scions of a royal line that had ruled the realm for centuries; Aegon is Aerys' grandson, thought to have been killed as a baby). The Targaryens are thoroughly swept up by this trope, believing their return will inevitably unite their people and restore peace to the realm. However, it's frequently shown throughout the series that there's not necessarily any correlation between right to rule, ability to rule, ability to win a civil war, or public reputation.
Fiona Patton's The Painter Knight is all about this trope; concerning an Usurper Evil Uncle who assassinates the monarch and seizes the regency of his five-year-old heir. She escapes his clutches with the help of a Ragtag Bunch of Misfits, who discuss and deconstruct the trope in the process of running for their lives.
Invoked in Summers at Castle Auburn. This is the image of Bryan taking power that everyone pretends is the truth, because the reality that he'll make a terrible king is too depressing.
In The Wheel of Time, this is the basis of the justification of the Seanchan's expansionist policy towards the Westlands: they are Arthur Hawkwing's legitimate heirs, and since Hawkwing's rule over the Westlands predate those of all of the current kings and queens, they are the rightful rulers of the place. Rand later throws back this argument to them in a quite hilarous way by pointing that since he is the reincarnation of Lews Therin, whose rule predates Hawkwing's by several centuries, he is the legitimate ruler of both the Seanchan and the Westlands.
A huge part of the back-plot of The Quest of the Unaligned. The current king and queen of the land of Caederan have unbalanced the four elements, favoring wind over the others and inducing hurricanes, tornadoes, floods, wildfires, and earthquakes all across the country. Most of the country has pinned their hopes on the return of Crown Prince Alaric, who has been raised in magicless Tonzimmiel and so theoretically should be able to restore the proper balance. Unfortunately, if he doesn't complete the titular quest by the summer solstice, he will be ineligible for coronation, and Caederan will almost certainly have its first civil war in two hundred years.
Played with in Daughter of the Lioness. The plot is about The Prophecy that the raka of the Copper Isles will be freed from their white luarin oppressors when a queen descended from the raka and luarin royal lines, but it's a part of a big power game between the Trickster God and his siblings, a lot of spycraft is involved on the mortal end, there are two candidates, and the one everyone wants is also the one they think won't be any good as queen. And then she runs away and her younger sister steps up, but she's a good queen mainly from becoming thoughtful, subtle, and intelligent from being in her sister's shadow.
Live Action TV
The Star Trek: The Next Generation episode "Rightful Heir" plays with this. Klingon messiah Kahless, the first Emperor of the Klingon Empire, seemingly returns, as he promised to, and claims the vacant throne of the Empire. It turns out that he is just a clone of Kahless raised to think that he is him, but Worf notes that he is still the rightful heir, and so he is installed as emperor, in a ceremonial role.
In Star Trek Expanded Universe, he is known as Emperor Kahless II, obviously showing that he's not the same person. Of course, one novel suggests that the DNA from which he was cloned may not have belonged to Kahless at all.
A constant theme in a whole litany of Jacobite songs and poems, some of which are really, really sad and depressing. Among the most famous:
Séarlas Óg- The predecessor of the much better known Óró, sé do bheatha 'bhaile, the song (rather prematurely) welcomes the Stuart prince Charles to Ireland, along with his French and Spanish allies, desperately awaiting the time when Charles and his men can come and banish the foreigners and the heretics from Ireland. Some other versions of the original song lament the fact that he couldn't actually get the French support he needed, which is more or less what happened in Real Life.
Mo Ghile Mear- A musical example derived from the tradition of Aisling Poetry, it is sung in the voice of a woman (representing Ireland) lamenting that the Stuart kings have gone away, and declaring that she cannot rest until she hears news foretelling their return.
Wha'll Be King But Charlie?- This Scottish song celebrates the return of Prince Charlie to Scotland, which happened in 1745, and declares the loyalty of all Scotland to their rightful Prince.
Charlie is My Darlin'- Another song commemorating Prince Charlie's return during The '45.
Will Ye No Come Back Again?- After the '45 Rebellion failed, Prince Charles fled Scotland and went back to France; this song laments that the Stuarts are leaving yet again, and wonders if they will ever return another time (they didn't).
When the King Enjoys His Own Again- Actually written after the English Civil War, when England was ruled by a military junta under the control of Oliver Cromwell, this song was resurrected as a Jacobite tune after 1688. "Yes, this I can tell", it goes, "That all will be well, when the King enjoys his own again".
Skye Boat Song- Commemorating Prince Charles' escape by boat after the failure of The '45, the last line promises "Charlie will come again".
There'll Never Be Peace Till Jamie Comes Hame- Commemorates the failure of The '15 and the flight of the eponymous James III, "the Old Pretender".
The original Jewish concept of the messiah was that a descendant of David would return to resume the dynasty, making it an example of this trope. Since this is one common interpretation of passages in The Bible (including as far back as the prophetic book of Hosea).
Jesus, who Christians believe to have fulfilled the aforementioned role of The Messiah, and who according to the Book of Revelation will do it again. He incidentally is also a descendant of David, fulfilling the Jewish prophecy .
Jesus' second coming in The Bible is in part to fulfill his role as the King of Kings and Lord of Lords.
Older Than Dirt: Horus in Egyptian religion, when he regained his father's kingdom from his murderous uncle Set, was held as the prototype of the rightful king ascending to the throne of Egypt and bringing order and justice to the land. Set, who murdered Horus's father Osiris (Set's brother), had usurped the throne of Egypt while Horus was growing up, and his unlawful reign was often depicted as a time of strife. Depending on the Writer, Set was either driven out in disgrace, or peacefully reconciled and shared the throne with Horus. References to this myth were made especially for royal coronations, as each reigning king was identified with Horus.
The basic theme of Exalted is the return of the Solar Exalted, previously deposed and sealed away by Sidereals and Terrestials. However, while heroic Solars are the default Player Characters, half of all Solars has been turned to dark powers and the ones that stayed shiny and glorious may be even worse. Moreover, the adventure book Return of the Scarlet Empress posits a subversion. The Empress also heralds the return of some of world's overthrown creators, but this is a verybadthing.
Richard III ends with Richmond, the rightful heir, recovering the throne from Richard. (At least, that's the way Shakespeare portrayed it — note that Queen Elizabeth was Richmond's granddaughter. The actual history is more controversial.)
Macbeth ends with Malcolm, the rightful heir, recovering the throne from Macbeth.
Hamlet is a subversion. Hamlet, the rightful heir, slays Claudius, who took over the throne, but doesn't live long enough to claim it himself. Then the kingdom gets taken over by Fortinbras, the rightful heir to another whole kingdom, because his kingdom had been usurped. By Hamlet's dad.
Subverted and then played straight by Gilbert and Sullivan in The Gondoliers. One of two Venetian Gondoliers is believed to be the heir to the vacant throne of the Mediterranean kingdom of Barataria; until it can be revealed which of them is the king, they reign jointly. But it turns out that neither of them was the king, and the actual king is restored to his throne at the end.
Varian Wrynn in World of Warcraft patch 3.0.2, after his prolonged absence from Stormwind ever since the game's launch, explained in the spin-off comic series.
In the original Warcraft series, the human kings suspected Anduin Lothar, the last descendant of the Arathi royal bloodline, wanted to rebuild the Empire of Arathor and that the Alliance was just a stepping stone to that goal. He had no such intentions.
The flagship campaign in the Battle for Wesnoth requires Konrad, the only surviving son of the former King, to retreat from his homeland amidst death threats, round up allies, and return later to conquer the kingdom from his aunt the Queen. Subverted, though; the real Konrad died 17 years prior with the rest of the heirs, and he's an (unknowing) impostor. Just before the final battle for Wesnoth, he has to hand over the kingdom to Lisar, who he befriended along the way.
Possibly double subverted in that, since she ends up marrying him in the lore, he gets to be king anyway.
Subverted in Oblivion when the amulet needed to restore Martin Septim to his throne is stolen. Later averted entirely when Martin gives his life to defeat Mehrunes Dagon.
Frequently part of The Legend of Zelda games, at least the ones where Princess Zelda is the rightful ruler. She's not going to return by herself, though; you (Link) have to rescue her.
Gilgamesh of Fate/stay night views his return to the living world as this. As the King of Heroes, he believes himself to be the sole rightful king of humanity with all other rulers being pretenders. His second life is a chance to reclaim his stolen throne and unite humanity once again.
After Calain's death in Dragon Age: Origins, Arl Eamon tries to invoke this trope with the late king's bastard brother Alistair. You can either go along with his plan, defy it by leaving a commoner-born queen on the throne or arrangea political marriage between both parties. Alistair and Leliana discuss this trope when they speak about how many ballads there are about lost kings returning to reclaim their lands from the usurpers.
A straighter example in the prequel novel Dragon Age: The Stolen Throne that takes place during the Orlesian occupation of Ferelden. The novel starts as Prince Maric's mother (the rightful Queen) is betrayed and killed by nobles seeking to earn favor with the Usurper-King (a distant cousin of the Orlesian Emperor). Maric barely escapes and, eventually, leads La Résistance alongside Loghain Mac Tir and Rowan Guerrin (Eamon's sister). In the end, Loghain is able to secure Ferelden's freedom in a decisive battle, and Maric is crowned King with Rowan as his Queen (although she really loves Loghain). The Usurper is publicly executed.
Yet Another Fantasy Gamer Comic sees King Eric III of Drostardy return to his throne after breaking out of a drow dungeon. (The reason he was in there in the first place? He hit on Arachne.)
While she isn't a Queen per se, Agatha Heterodyne reclaiming her birthright by taking Castle Heterodyne and triggering the ringing of the Doom Bell definitely has major overtones of this trope.
Tarvek Sturmvoraus is the end result of the plots of several factions (it's complicated) to create an heir to the Storm King and use him to legitimize their conquest of Europa. He wasn't really pushing his claim, but Martellus von Blitzengaard, another possible Storm King, appeared on the scene pressing his.
Later, they're both out of favor with the factions for various reasons and current front-runner for the title of Storm King is none other than Gilgamesh Wulfenbach.
In Jonny Quest: The Real Adventures, it turns out that Hadji has Royal Blood, and was to become the Sultan of Bangalore, except his evil uncle and cousin killed his father, locked his mother up and tried to kill him to take the throne, back when Hadji was just a little kid. Of course he didn't die, he was saved by Pasha the Peddler and eventually adopted by Dr. Quest, which Pasha facilitated in the original series. Later on, with the help of the Quest Team, he saved his mother and took back his throne.
Papa Smurf also plays this role in "King Smurf" when he returns to stop the fighting among all his little Smurfs and to put an end to King Smurf's role as king.
Inverted in The Simpsons, "Simpsons Bible Stories" episode. As part of a retelling of the story of David and Goliath, David (Bart) was forced into exile by Goliath II (Nelson). David reclaims his throne, however, his people arrest him as Goliath II (the Consensus Builder) was a popular ruler who genuinely improved their lives.
Real Life examples: Charles II (Britain and Ireland), Louis XVIII (France) and Juan Carlos (Spain).
Juan Carlos is an especially modern one. Son of Kings in exile he was taken by Franco and made his Heir since he was the rightful King. Juan Carlos made pleasing sounds, and once Franco was dead, he arranged for a new constitution, ended the authoritarian state, turned Spain into a modern democracy, crushed a coup trying to force it back into a dictatorship and pretty much gave up all his power under the constitution. By the end, even the Communist Party leader was crowing, "God Save the King!"
A while back, it turns out that one of the Kings of England may have been illegitimately born, which if true would, technically, make pretty much the entire current royal family illegitimate. They tracked down the direct descendants of the legitimate heir... a Scottish lord living an ordinary life in Australia, who does not even use his use his legal title (14th Earl of Loudoun) in public.
The Edward IV legitimacy question crops up a lot, but it's ultimately not material to who sits on the throne today. Parliament decides the succession, and the current royal family has been explicitly asked to take the throne on two separate occasions (the restoration of Charles II in 1660, and the Glorious Revolution in 1688).
Doubly immaterial because the Act of Settlement 1701 provided that, should William III and his sister-in-law Anne both die without issue (which they did), the throne would pass to the Elector Sophia of Hannover or her (Protestant) descendants, effectively "resetting" the royal line. (Sophia died before William did, so the claim passed to her son, George I.)
Of course, such claims crop up all the time — a historian recently claimed Queen Victoria was illegitimate, which if true would pass the throne to a minor member of the Danish royal family.
Hell, there are claims now — some speculate that Prince Harry is not Prince Charles's son, therefore after Charles and his elder son William, the next heir would be Charles's brother the Duke of York. That claim is now irrelevant as of July 2013, since Prince William's newborn son is now third in line to the throne.
And, of course, there's still the Jacobite claim, the current heir being Franz, Duke of Bavaria, or "Francis II". He himself declines to pursue it, though, and the only remaining advocacy groups are essentially aristocratic clubs with a quirky title.
Also, England tends to be more loose about illegitimacy when it suits them - William the Conqueror was known as William the Bastard until 1066 for an obvious reason, and Henry VII had inherited his claim to the throne from an illegitimate son of John of Gaunt, son of Henry IV.
Happened a number of times in World War II: King Haakon VII of Norway, Queen Wilhelmina of the Netherlands, and Grand Duchess Charlotte of Luxembourg were forced to flee to the court of King George VI in London when the Nazis overran their nations (Wilhelmina later relocated to Canada temporarily). They became major symbols of resistance for the occupied nations, and returned home in 1945 on the heels of the Allied armies.
Similarly happened at the end of World War One, when the royalty of most of the occupied nations (including Belgium, Serbia, and Romania) returned to their capitals. Subverted in the case of Luxembourg, where the Grand Duchess' collaboration with the Germans did not play well as Luxembourgians fought and died elsewhere against the Germans, and the return of the Allied armies in fact saw her being forced to abdicate. Averted but tried in the case of Montenegro (where the Serbian crown forced a union of the South Slavic states under the rule of Belgrade in the face of armed Montenegrin resistance), and Russia (where the Whites tried to resurrect the monarchy but were defeated by the Bolsheviks).
King Ferdinand I of Romania had fled to the north of the country by 1917, but did not leave Romanian territory. He understood how the resistance to the Imperial German forces might have collapsed if he appeared to have fled the country.
Averted with Charles of Austria-Hungary. With the threat posed by the Allies and the Little Entente, along with Horthy, the aim of reclaiming Hungary was doomed to fail.
Attempted a number of times by the Jacobites (the displaced Stuart heirs of James VII/II of Scotland and England) in the 18th century, but it wasn't to be.
Similarly done twice in Canada: John A. MacDonald served as Prime Minister from 1867 to 1873 and returned to power in 1878, dying in office in 1891. Pierre Trudeau was Prime Minister from 1968 to 1979, returning a year later after Joe Clark's minority government collapsed. YMMV on both, naturally, though especially with Trudeau.
It used to happen quite often in parliamentary-style governments: consider the Earl of Derby, who was prime minister of Great Britain on three non-consecutive occasions in the 19th century. The most recent example would be Harold Wilson in the 1960s and 1970s. (Nowadays a prime minister who loses an election is expected to resign as leader of his party, and will never get another shot at the top job.)
Actually done four times. Arthur Meighen was Prime Minister from 1920-1921, returning for a few months in 1926 during the King-Byng Crisis. Mackenzie King was Prime Minister from 1921- June 1926, returning to power in September. He lost the 1930 election, coming back for a third and final time in 1935 (this time he stayed on until his retirement in 1948).
Deliberately invoked by Napoleon's Genre Savvy nephew, Louis Napoleon, who, despite being of no recognised royal bloodline, capitalised on Bonapartist nostalgia in 1840's France, later having himself declared Emperor Napoleon III (retroactively declaring his uncle's deceased son to have been Napoleon II).
Napoleon himself managed it briefly, during the "Hundred Days" of 1815.
When the Sultan of Sokotonote Sokoto is a city in majority-Muslimnorthwestern Nigeria; in pre-colonial days it was the center of a powerful empire. Furthermore, its Sultan considered himself the Caliph—legitimate "successor" of The Prophet Muhammad as leader of all Muslims—and as a result the Sultan of Sokoto, while holding no formal political power, is considered to be an important spiritual and community leader for northern Nigeria's Muslim population. died in the late 1980s, Nigerian Dictator Babangida passed over the heir apparent Maccido and installed Dasuki, a personal friend from the Royal House. In the mid 90s, new dictator Abacha put Dasuki under house arrest, and installed Maccido as Sultan, to general approval from the caliphate geeks.
Invoked during the 1868 Meiji Restoration in which the Japanese Emperor usurped political power from the Shoguns who had been running the country for the past 700 years.
King Michael of Romania was a figurehead ruler during most of his reign in the 1930s and 1940s. A fascist dictator came to power in Romania, who allied his country with the Nazis. In 1944 Michael, along with several generals loyal to him, organized a coup against the fascists and became allied with the West and the Soviets. Romania's communist government forced the king into exile in 1947. He eventually returned in 1992 and on a more permanent basis in 1997 although Romania does not recognize him as their monarch.
Tsar Simeon II of Bulgaria was only six when he took the throne in 1943, and was exiled three years later after the Soviet-backed transitional government held a plebiscite to end the monarchy. He spent his childhood hopping around the Mediterranean, became a successful businessman in Spain, and generally just lived his life...until the communist government of Bulgaria collapsed with all the others. Simeon—now styling himself Simeon Sakskoberggotski ("Saxe-Coberg-Gotha", using the name of his royal housenote Yes, the same as The House of Windsor before World War One as his surname)—founded a political party and led it to victory in the 2001 elections, with Sakskoberggotski himself becoming Prime Minister. Incidentally, this is the only time a hereditary monarch has ever gone on to become a democratically elected head of government in any nation. It even fits the "situation in the country improves" bit of the trope—he appointed a cabinet of technical experts (though their actual competence is disputed) and Bulgaria grew and ran smoothly during his tenure. However the Bulgarian voters grew tired of the massive corruption which his government was widely accused of and also how most of the growth seemed to flow to the rich, and left his party in second place in the 2005 elections (although the party ended up participating in a grand coalition led by the Socialists), and then wiped them out entirely in 2009 and Simeon retired from politics.
Simeon II always advocated the restoration of the monarchy when living in exile, but after his return has remained silent on the issue. No matter how many times people ask him if he still wants to return to being Tsar (either as a figurehead constitutional monarch or with some degree of actual power), he gives no answer.
Mohammed Zahir Shah of Afghanistan was deposed by his prime minister in 1973 while seeking medical treatments in Italy. During his exile Afghanistan experienced a communist dictatorship, a civil war, and the rise of the Taliban. He returned to Afghanistan in 2002 after NATO began its occupation of that country, however, the Americans would not let him take the title of king. He was allowed to serve as an apolitical symbol of national unity.
During the unification of Japan in the late 16th century, the most powerful and successful faction was led by three of Japans greatest and most famous generals, Oda Nobunaga, Toyotomi Hideyoshi, and Tokugawa Ieyasu, who all wanted to be the ruler of Japan. Famous for his patience and being the youngest, Ieyasu left the position to Hideyoshi after Nobunagas death and waited for his own time to come. However at his death, his five year old son Hideyori was a problem and Ieyasu could not deny a dying mans request to protect his young child. Even though Ieyasu was quite successful in arranging that Hideyori had no intention to follow in his fathers footstep, Ieyasu realized that as long as the Toyotomi family existed, there would always be rebels gaining support by claiming to restore the rightful ruler of Japan to power. Though there are many sources that indicate that it pained Ieyasu deeply, the legacy of the Tokugawa family would only endure if Hideyori and his own young son were killed. Which they were.
Invoked during the Meiji "Restoration." During the Shogunate rule in Japan, even the existence of the emperor was barely recognized. The rebel forces opposing the Shogun, however, took on the emperor as their figurehead and claimed to be merely restoring the rightful ruler to power. It had been many centuries since the last time a Japanese emperor had actually been in power, rather than just a figurehead who the shogun controlled.
Zigzagged during the Liberal Wars in Portugal. Leading the Liberal forces was Dom Pedro, who was simultaneously the former crown prince, former Rebel Prince (who led the former Portuguese colony of Brazil to independence), former king (briefly in 1826 after his father, Joao VI, had died), and the father of the deposed "rightful queen," Maria II.
After the Khmer Rouge was overthrown from Cambodia, Norodom Sihanouk was restored as the King of Cambodia when the communists removed him.