Given that people, once they've fallen behind in the polls, commonly talk about pulling off an upset that usually fails to happen, I was just wondering if there has ever been such a case in which a candidate managed to pull off a comeback victory.
(Important caveat: elections are a hobby of mine, not a specialist area of study.)
Just within the time limit allowed here, but within the United Kingdom, the 1992 general election is often cited as an example of opinion polling getting the result horribly wrong.
Margaret Thatcher had led the Conservative Party to victory in the 1979 general election, and then onto two landslide re-elections in 1983 and 1987. After 1989 though, the party's popularity began to seriously decline and the opposition Labour Party took a strong lead in the polls. Thatcher was ousted as Prime Minister by her own party in 1990 and replaced by her Chancellor (Finance Minister), John Major - this gave the Conservative Party something of a boost, but Labour, led by Neil Kinnock, remained ahead in most polls.
Going into the statutory 1992 election, it was widely expected that Labour would be the largest party in the House of Commons after the result. The last poll of the campaign suggested Labour would win 42% of the vote, the Conservatives 39% and the third-party Alliance 17% - a result that would probably have seen Labour just short of a single-party majority government, but easily ahead of the Conservative Party, which ought to have lost around 80 seats.
On election night, exit polling for the BBC had the election too close to call but, to the surprise of many, suggested that John Major's Conservatives were narrowly ahead - neither party was likely to win the election outright. On election night, it seemed likely that John Major would still be ousted as Prime Minister, as the Alliance was thought to prefer a Labour government over another Conservative one.
The final result turned out to be very different to any polling expectations, though. The Conservatives won 42% of the vote and 336 seats - the same vote-share they had won in 1987, and enough to govern alone comfortably (though they would go on to lose their majority through constant by-election defeats over the next half decade). Labour only managed 34% of the vote, far down on expectations - they made considerable gains, but only half or less than half as many as the polls had suggested, and the party still had a smaller share of seats in Parliament than it did when Thatcher first led the Conservatives to power.
Though a few claims were made to explain how the polls go it so wrong, pollsters later determined that there was a "shy Tory factor" at play - knowing that the governing party was unpopular, people were embarrassed to admit voting Conservative. As a result, polls were thought to be showing Labour narrowly ahead when Labour was actually behind the entire time.
The 1948 United States presidential election is another famous example from the infancy of modern opinion-polling; Republican candidate Thomas Dewey was widely expected to defeat incument Democrat Harry Truman in his bid for a second (and first full) term. On election day, Truman carried 28 states for 303 of 531 electoral votes, and beat Dewey by a couple of million popular votes - hence this famous picture of Truman looking surprisingly happy for a man with a copy of a newspaper announcing his defeat!
I won't go into detail because they're outside the 20 year rule, but for more recent examples with a lot of commentary and analysis you could go look for, you might be interested in the Alberta 2012 and British Columbia 2013 elections in Canada.
Aloisio Nunes in Brazil wasn't even rated as 3rd place for senator in são Paulo - Brazil and was the highest voted senator in Brazil. That happened in 2012.