Self judgment

I have a goal to lose 70 lbs. In January, I lost 8 lbs. Then I gained it all back in February. I find myself full of thoughts of self recrimination and judgment for overeating off protocol, and those thoughts result in feelings of shame. Then I continue to overeat, which proves my original thoughts. How can I break this pattern?