When they asked the 100 year old man how he lived so long he replied.
"Short memory"
I think you have to find a way to forgive yourself, learn from it, and then move on. It also helps to examine your motives. If you are trying to do what is right and you fail, you shouldn't beat yourself up over it.
I wish my parents had helped me realize, when I was young, that it is okay to strive for success, and sometimes fail. To many people sit around, and do nothing, in fear of failure. I've stumbled, many times, and it only makes succeeding sweeter.