Don't let it get you down. You've got to live with your diabetes. Okay so what you ate put your numbers up for a time. You can balance it out. If you don't have the occasional treat all you're doing is existing not living. Don't beat yourself up.
It soon becomes second nature to think 'if I have this and this, then later I'll only have this'. Or exercise is a good way of bringing down numbers. I've seen my brother eat a chocolate bar and then spend an hour or two doing laborious gardening to balance it out.
Also once you've eaten it, it is past, and you can't change the past. Note it for next time and move on.
MTT