As Virgin America announced plans for its long-awaited IPO, Sir Richard Branson confided over a late-night beer just how maddening it can be to launch any high-flying business, even with more than 350 other companies under the Virgin brand. Back when the Bay Area-based airline was getting started, Virgin America's competitors viciously contested the newcomer's arrival for what seemed like an eternity. Price wars, lawsuits, and regulatory battles all soaked up precious resources.

"The knee-jerk reaction you feel when you're under attack is to assume a siege mentality," Branson said. But your fight-or-flight instincts are "a self-indulgent waste of time and money." Instead, the legendary entrepreneur and his partners focused on reinventing the customer experience for domestic air travel, eventually winning share in the insanely competitive airline industry.

Branson said that rather than ever feel threatened or even sorry for himself, he's always comforted by four principles that guided his longtime mentor, Nelson Mandela, whose circumstances were obviously far more desperate than any of us will ever experience.

1. Let your mission, not your nightmare, define you.

"Resentment is like drinking poison and then hoping it will kill your enemies," Mandela once said.  Vengefulness and victimhood would not erase the crimes done to him in the past, nor would they help him build a better future. Mandela could have emerged from decades of jail "still imprisoned by bitterness," Branson said. "Instead he devoted every ounce of creativity to building a lasting legacy--just as each of us should during our lifetimes. Get over it and build a great business!"

2. Focus on what you're for (the customer), not what you're against (the competition).

Rather than getting sucked into a protracted, bitter feud with competitors and the government, it's much better to let your adversaries waste their energy fighting each other. Virgin America didn't get distracted by turf battles and name calling, and instead focused on building a community of customers who loved Virgin's fresh, edgy vibe.

3. Being persistent does not mean being inflexible.

"Do not judge me by my successes," Mandela admonished. "Judge me by how many times I fell down and got back up again." When you're suffering a setback in your startup, imagine how much worse Mandela had it--and just how creative he had to be in a cramped cell every night. From dawn to dusk, he dragged stones in the blinding heat. You can't steel yourself year after year dreaming that hopeless circumstances will change, he said. You have to change the way you deal with the circumstances. Being flexible in finding a new door every time the last one slams shut is the difference between those who find their way and those who self-destruct. "That's the kind of grit and creativity you need to be an entrepreneur," Branson insists.

4. You don't have to be perfect to make a difference.

I will never forget Mandela's warm embrace as he almost collapsed in my arms after midnight during his last visit to the World Economic Forum, the invitation-only summit in the Swiss Alps where CEOs, presidents of nations, noble laureates, artists, educators, and billionaires convene every winter. I was executive producer of, and I was writing a book interviewing hundreds of leaders in Davos for my sequel to Built to Last with Stanford professor Jerry Porras. Almost every thought leader I met pointed to Mandela as a role model for leadership. With a smirk, Mandela told me that perfection was never a part of his plan and he "never achieved it."

In the years before Mandela, an activist lawyer, had been sent to a death camp, he was rarely without zealous overconfidence about his mission to end apartheid. Although Mandela initially advocated a peaceful solution, he eventually took up arms when the path of peace appeared to be a dead-end. In 1964, he was convicted of conspiracy and sabotage and sentenced to life in prison. The fact that he didn't start out as a complete saint with perfect grace or humility before his long walk to freedom, makes his journey even more useful to the rest of us.

"You have enduring impact not because you are perfect or lucky," Sir Richard sighed as he finished a beer, "but because you have the courage to stay focused on building a better future rather than dwell in the past."