Keep losing weight after June

I lost exactly 8 pounds in June!
I followed my plan about 80% of the time, got the results and was totally in control. I thought it was almost easy.
But then July arrived, and I did not intend to give up sugar and flour forever. Just putting it into my mouth and my brain was urging me to consume more. I feel so dumb for falling for this lie.
I don’t want to gain the weight back! I don’t want to go back to being obsessed with my weight (such a waste of my brain power!) I lost enough of my life thinking about this, arguing with myself, fighting over wanting to eat stuff. I feel pathetic, powerless.
I had powerful thoughts in June, because it was “Just for June,”right? That means I still don’t know how to allow my urges, right 🙁