You can do it. My best tip for when you mess up is start over IMMEDIATELY. We tend to go, "well, today's shot." And eat whatever the rest of the day. Or worse "Well, the weeks shot. I'll start over on Monday." Start over right away.
One *bad* meal doesn't mean failure. And if you only have that one thing, you don't have to feel bad. It was just one thing. Moderation allows foods we would normally feel guilty over to become foods we can sometimes just enjoy.
If you are in your pre-op diet, its important to stick to it. It does shrink your liver, making it less likely to be in the way and accidentally nicked. And for me, following it gave me the confidence to know that I'd be able to stick to my post op diet.
Good luck on your upcoming surgery. Keep us posted.