Made a big mistake

So, I did something out of spite, revenge and got “caught”. I feel guilty and shameful.
I brought this on myself and 100% take responsibility and will face the consequences. In the meantime I’m trying to do the work I’ve learned here in SCS but am a little unsure of what to do.
I can’t stop thinking about it and have a sick stomach constantly. I want to get through this to my future self with a really great lesson learned and better person on the other side.

I’ve been trying to think thoughts like “I’m a strong woman and will get through this even stronger” but most of the time I find myself just thinking about how stupid and shameful I feel and rehashing the mistake over and over in my mind.
I also found myself today wondering about breaking protocol and eating just to feel better (I have been sugar and flour free for 3wks and haven’t loooked back so this felt alarming).

How can I stop rehashing and start moving forward? Or should I sit longer in this shameful feeling since it was truly my fault?

Thank you!