Read this study from 2007:
There are several key take-aways from this which correlate with what's been said on this site before.
One, this quote:
"The findings ... are consistent with several other prospective studies indicating that dieting history is related to risk for future weight gain."
That's right: going on a deliberate weight-loss diet actually increases your chances of gaining weight in the future.
Then there is this quote:
"The most rigorous designs in studies of long-term weightloss maintenance are those that randomly assign individuals to a diet condition or to a no-diet condition and then follow them over time. [...] Very few such studies include long-term follow-ups that allow for clear comparisons between the weight of dieters and the weight of control participants...]
The important point to note is that there are many studies on weight loss but very few high quality studies on keeping that weight off. This would be akin to having many studies on the odds of surviving cancer surgery but few studies on the likeliness of the cancer coming back. The problem is that most weight loss 'science' focuses on the wrong topic - short term weight loss. Very little good research has been done on keeping bodyfat from coming back. It's crucial to understand that most of the science and clinical practice is built on finding answers to the wrong question.
Weight loss is not a healthy goal. Staying lean is a healthy goal. Focus on long term outcomes rather than victories in short-term skirmishes.
So you lost 10 pounds, 20 pounds, 40 pounds. Big deal - follow-ups from the show "The Biggest Loser" reveals that most of the contestants are fat again. They lost even more weight than you.
"Pyrrhus replied to one that gave him joy of his victory that one more such victory would utterly undo him."
Work on your lifelong habits, not your short-term Pyrrhic victories.