Pivots are gut wrenching. The more eyes there are on the company, the tougher pivots are. Therefore, public-company pivots are usually the most gut wrenching. Many public companies of the past ceased to stay public because their leaders couldn’t face the pivot. Their businesses declined, and they were eventually delisted from NASDAQ or the New York Stock Exchange.

Two-and-a-half years ago, Facebook went public. Initially, it wasn’t pretty. It led to articles like “7 Reasons Why Facebook IPO Was a Bust.” CEO Mark Zuckerberg’s roadshow hoodie was mocked (or praised, depending on your point of view). Morgan Stanley’s lead tech investment banker, Michael Grimes, was derided by the media for months. I know Grimes and think highly of him, and it was painful for me to see him go through this. Facebook went public May 17, 2012, at a price of $38 per share. A few months later, on Aug. 26, 2012, you could buy a share of Facebook for $18.06. What happened?

No doubt, Facebook was the most overhyped initial public offering of 2012. However, private-market buyers on exchanges like SecondMarket were paying around $38 per share for Facebook stock before it went public.

Why didn’t the Facebook stock price stay above $38 then? Because Facebook was caught with one of the most radical platform shifts in the history of technology: the shift to mobile. Look at what has happened over the last two-and-a-half years with this chart produced recently by Business Insider, after Facebook reported fourth quarter earnings:

HurtFacebook1

Since Facebook went public, non-mobile advertising has essentially stayed flat while all of the growth has been in mobile advertising. And look at the shift in users from desktop to mobile since Facebook went public:

HurtFacebook2

This shift toward mobile is exactly what the market was terrified of right after Facebook went public, and it was reflected in that low valuation of $18.06 per share. The market saw the stunning, hard shift of users from desktop to mobile, and Facebook didn’t have a good mobile strategy. They were facing an epic pivot and needed to execute it “flawlessly.”

So how did Facebook go from $18.06 per share on Aug. 26, 2012, to $75.91 per share at the end of January?  Zuckerberg did something that only the bravest CEOs can pull off. He forced the entire company to hard shift alongside their users (i.e., their customers) and put everyone on “lockdown” to get their mobile strategy right—to make mobile the central focus of Facebook. And, most importantly, it worked—big time. Nearly 70 percent of Facebook’s $3.59 billion of advertising revenue now comes from mobile.

Today, Grimes, Zuckerberg and Facebook Chief Financial Officer David Wehner are victors as a result. And for those who held on to their IPO  shares, they are now sitting on a more than 200 percent gain in just two-and-a-half years—a very rich return to say the least.

What I do know is that IPOs aren’t easy and public-company pivots are very difficult. Let’s look at history for a bit.

Amazon.com Inc. had a wild ride to become the $164 billion juggernaut it is today. Amazon’s valuation shot up $25 billion over a recent two-day period as it delivered on a long-awaited net earnings beat, showing that it can indeed become profitable if it chooses to do so (read this great post by Benedict Evans). Looking back, it was valued at $1.97 per share in April of 1997, rode up to a high of $86.09 just two years later at the peak of the bubble, then rapidly fell after the bubble burst and traded in a zone of $10 to $14 a share for years, while analysts proclaimed it would never get profitable and most likely go out of business. As of a few days ago, it is worth $354.53 per share.

Salesforce.com, the most valuable software-as-a-service (SaaS) business in history, was mocked by Oracle Founder Larry Ellison after it went public. Ellison said that SaaS would never take off because of its inferior functionality and enterprise integration options. SaaS, however, evolved even faster than Oracle in these areas because of SaaS’ unique business model ability of developing on a single platform. Enterprise software, by contrast, had to deal with many disparate platforms and integration partners. Today Oracle, SAP and other giants buy their way into SaaS as fast as they possibly can because their industry is in fact hard-shifting. Salesforce.com traded in a range of $4.02 per share to $11.81 per share for its first three years as a public company, only to rise to $18.08 per share and then fall back to $6.65 per share by the time it had been public for five years. As of this weekend, it is valued at $56.45 per share. The company is valued at $35.6 billion.

In short, all that matters is how a company does long term, whether it is a private or public company. And on that point, again, I feel very good about the management leadership at Bazaarvoice and was happy to see the recent Needham Growth Conference presentation Jan. 13 (available online). One of the pivots Bazaarvoice made, led by Gene Austin, was to buy FeedMagnet and launch the new Curations solution, as social networks like Facebook, Instagram and Twitter continue to grow in prominence and users. Another pivot Bazaarvoice made while I was CEO was the tech platform pivot to incorporate responsive design across our solutions so we, like Facebook, could be mobile first, from phones to tablets and screen-sizes of all dimensions versus the fairly static nature of desktop/laptop screen browsers.

Back to Facebook, the company should feel very, very good. Zuckerberg led it through the most epic tech company pivot of this decade. Shareholders and employees—assuming they held on to their stock—are reaping the rewards of his bravery and clarity. And Zuckerberg didn’t just stop with a radical internal lockdown on focus but also an external one. Bravely acquiring Instagram, WhatsApp and Oculus Rift, the first two acquisitions squarely aligned with the hard-shift to mobile, and the latter is an opportunity for Facebook to become the next Microsoft, if Oculus becomes the next visual computing platform that we embrace like we have with Microsoft Windows in the past.

If you are a leader at a startup or an investor in one, I strongly encourage you to watch Mike Maples Jr.’s presentation on the gut-wrenching but incredibly necessary nature of pivots. Mike helped Twitter through its private-company pivot in the company’s earlier days. Watch his speech here.

Here are some other pivots I consider “epic.”

Google’s pivot to compete with Amazon, Alibaba and other marketplaces with its launch of product listing ads (PLA) is already estimated to be an $8 billion business for Google. Some estimates predict PLAs will grow into a $20 billion to $40 billion business overall in the next few years. I considered this a pivot because Google wants to remain our one-stop shop—the entrance to the mall, if you will—instead of us going to Amazon, where around 50 percent of Amazon’s business now is marketplace revenue. It is Google’s best second-act to date. Google Express is another move to the marketplace strategy, but it is too early to tell how it will perform.

Where is the public credit for Jerry Yang purchasing such a large stake in Alibaba while he was in the position to do so at Yahoo? That stake is now worth around $47 billion in cash, which is more than Yahoo’s market cap. This is a pivot in the making, and we’ll see how CEO Marissa Mayer does over the next two to three years. She is clearly on an acquisitive trail but, I believe, often losing to competing bids from Google and Facebook.

What about the U.S.’s pivot to shale? This tech pivot has destabilized the worldwide oil industry. This pivot has radically changed world power structures, with Russia and other oil-economy-dependent countries struggling and OPEC not sure what they should do in terms of adjusting oil supply and pricing.

I would love to hear about what you think the best tech company pivot of the decade is, how you’ve been able to pivot your company, and how gut wrenching it was to do so. Let’s all learn from your experiences.

Editor’s note: The original version of this post appeared on Brett’s Lucky7 blog on Jan. 31, 2015.