The most important thing here is to learn from what you did. Why did you eat it? What is a trigger for you? Were you bored, worried, happy, celebrating, stressed? Do you tend to always comfort yourself with food in those circumstances? Is this a pattern for you? Was there anything else you could have done instead? For example, could you have addressed the cause of your stress rather than comforting yourself?
By becoming more intraspective and understanding why we do the things we do we are far more likely to be able to address our issues and maintain in the long run.