There is a bit of controversy because the French themselves in the 19th century were divided on whether members of the House of Orleans, a cadet branch of the Bourbon dynasty, were legitimate monarchs. Those who believed the Bourbons to be the rightful monarchs were known as legitimistes, those who supported the Orleans, orleanistes.
The two houses reconciled their differences during the Third Republic but there's still an open debate on the subject. The legitimiste position is further complicated by the fact that the French branch of the Bourbon dynasty is extinct, and its nearest cadet branch is part of the Spanish royal family line that renounced its claim to the French throne after the War of the Spanish Succession.
There is also a third faction, the bonapartistes, who would prefer to see a restoration of Napoleon's line, although in the context of a monarchy rather than empire, I don't think they have a credible claim.
That in mind, let's take a look at who was reigning at the times you've asked about:
In 1789, the Bourbon Louis XVI was deposed, and the First Republic declared in 1792.
In 1830, the Bourbon Charles X was replaced with the Orleanist Louis-Philippe.
In 1848, the Orleanist Louis-Philippe was overthrown, and Louis-Napoleon was elected president; in 1852 he was declared emperor.
In 1871, Louis-Napoleon was removed from power and the Third Republic declared.
So, if we accept the legitimiste claim, the current pretender is Louis XX, Louis Alphonse, Duke of Anjou. If we accept the orleaniste claim, the current pretender is Henri VII, Henri d'Orleans, Count of Paris, Duke of France. If we accept the bonapartiste claim, the monarch is (and I have to admit, this I did not know, so I'm relying on Wikipedia) Jean-Christophe Napoleon.
I don't think you could convince the legitimistes or orleanistes to change their opinion on who the rightful heir would be, but once you've picked a side, I think the answer would be the same in any case, except 1871 when the bonapartiste claim might be stronger.
Obviously it would depend on which of the three Houses that claim the throne of France were restored. The Bourbons (overthrown in 1830 in favor of the Orleans), the Orleans (overthrown in 1848, initially in favor of a republic) or the Bonapartes (overthrown in 1871, the last monarchs of France).
The Bourbons recognize King Charles X as the last true king of France. So for them it would go to the nearest male descendant of the latest in the line of French Kings for whom a descendant could be found. I believe the current lead contender for that title is is Louis Alphonse, self-styled Louis XX of France. He claims succession as the eldest descendant of Louis XIV.
The Orleanists believe that the House of Orleans ascension to the throne in the 1830 revolution is legitimate. Therefore King Louis-Phillipe was the last rightful King of France. His nearest descendant appears to be Henri d'Orleans (self-styled Henry VII).
The Bonapartes recognize Napoleon III as the last rightful emperor of France and therefore the nearest male family member to him is the rightful ruler of France. Sorta, see the Bonapartes are kinda an interesting family and it is traditional for a leader of the House to select the next in line, even if it skips ahead a generation or so. The current head of the House appears to be Jean-Christophe Napoleon.
I keep saying appears to be, because with royalty there are always disputes over who is descended from whom and who has the rightful claim to the throne. There are also disputes about what law you use to determine succession (such as the neat interpretation that makes the Kings of England the rightful Kings of France (although they surrendered that claim during the French revolution).
This submission has been removed because it involves current events. To keep from discussion of politics, we have a 20-year rule here. You may want to try /r/ask_politics or another current-events focused sub.