That doesn't mean you will automatically lose just because you sometimes suffer setbacks.
Common setbacks include:
Not eating properly.
Not exercising enough or keeping to your scheduled routine.
Getting distracted by work or family concerns.
Slacking off due to lack of motivation.
But just because you encounter a setback doesn't mean you should just give up and let things spiral out of control. You have to realize ahead of time that there will be setbacks and you have to learn to embrace the challenges given to you.
Nobody is going to blame you if something happens (eg. a funeral for a family member or friend) and then you slack off a bit. That type of thing just happens and is part of life. You take the necessary break and then you get right back to your routine as soon as you feel ready.
Many people on a weight loss regimen have slipped up / slacked off from time to time. Even the professional bodybuilders, athletes, etc sometimes fall behind on their schedule. Unfortunately sometimes due to lack of willpower it can quickly spiral out of control. Say for example you have one snack outside of your meal plan, it may be easy to say, "Well I already messed up today, so what's another?" This can turn into a truly self-defeating cycle and before you know it you're binging on doughnuts and have completely stopped exercising. That one day can turn into the whole weekend, and weekends turn into weeks. And you might not stop the cycle for months.
But if you realize ahead of time that you will make small mistakes then you can make those mistakes and keep on pushing forward despite the small setbacks.
The only way out of this is to get it together mentally and not allow little mistakes to chip away at your determination to make changes in your life. One, two or even ten bad days are nothing compared to the days in the year and beyond.
Yes, it can be upsetting to lose progress, especially when you have no control over it due to an illness or injury. We work so hard to achieve success, and then a loss of willpower or a lazy streak can really take away from the progress that we busted our butts for and our motivation will be sapped. Dwelling on the mistakes won't bring you six-pack abs however. The only way to feel better is to pick yourself up, and get started again as if nothing had even happened.