1) Friends and family. Talk to them, a lot.
2) Taking some time to recover, but not too long. If it's been 8 months, you probably need to at least look at something else besides sitting in a funk. Ask your friends what they think.
3) Get up on the horse again, but with a different horse. Sometimes you face a problem you can't beat. It's okay to go find a problem that you can beat. This really helps your confidence. Maybe do something less ambitious.
4) Realizing that you have gained things (like experience, contacts, knowledge, etc.) as well as lost things from your experience. It's easy to dwell on the losses; I know that I do. But your friends can help you see what you got out of the experience - remember that some people spend $200k on school and may have learned less than you did.
5) Finding a new project. It may take you a while to get to the point you can do anything about it, but it helps to have a positive future goal to think about.