The key to success lies in how you react to your mistakes. Here's some thoughts from the Daniel Dennett's new book, "Intuition Pumps":
"The chief trick to making good mistakes is not to hide them — especially not from yourself. Instead of turning away in denial when you make a mistake, you should become a connoisseur of your own mistakes, turning them over in your mind as if they were works of art, which in a way they are. The fundamental reaction to any mistake ought to be this: “Well, I won’t do that again!”It's hard to savor your mistakes. As Dennett points out, thinking about our own failings is usually uncomfortable and unpleasant. But adopting the right frame of mind can help you do it.
So when you make a mistake, you should learn to take a deep breath, grit your teeth, and then examine your own recollections of the mistake as ruthlessly and as dispassionately as you can manage. It’s not easy. The natural human reaction to making a mistake is embarrassment and anger (we are never angrier than when we are angry at ourselves), and you have to work hard to overcome these emotional reactions. Try to acquire the weird practice of savoring your mistakes, delighting in uncovering the strange quirks that led you astray. Then, once you have sucked out all the goodness to be gained from having made them, you can cheerfully set them behind you, and go on to the next big opportunity."
I always remember what someone told me about how he succeeded at his diet. "Every time I feel hungry, I tell myself, 'This is the feeling of you getting thinner.'"
Entrepreneurs usually make the mistake of following one of two extremes when it comes to mistakes--they either ignore the mistake, or they beat themselves up about it. Both squander the learning opportunity a mistake affords; you shouldn't waste time denying reality or on useless self-flagellation. Instead, accept that you screwed up, and figure out what silver lining you can salvage.