I have battled binge eating disorder, so I am in your shoes. I am much better, but still have frequent binges. I try to learn from my experience and take preventative steps. I have certain emotional triggers - boredom, loneliness, and hopelessness and, when combined with opportunity, I will binge.
In therapy, I learned about the addiction cycle. Basically, it means the setup for the next binge happens long before you notice it. The binge triggers can be subtle, so try to learn what they are. And plan ahead how to combat it in the future.
Try not to beat yourself up. That will make you worse. Instead, focus on building your self-esteem and doing something positive.