What size of pizza are we talking? If you had 5 slices of a small, it's not nearly as bad as 5 slices as a large or xl. It even comes down to toppings, although given my love of meat topped pizzas, I'm just going to assume it was some form of meat-lovers
Here's the thing, at the end of the day, no food is off limits. My husband and I went to a movie last week and planned to eat after the show, only we couldn't get tickets for the one we wanted to go to, just the one starting an hour later - not giving us time to go find a healthy option. So we opted for a giant slice of cheese pizza each with our giant bag o' popcorn. I was convinced that I'd be way out of my calories for the day. So much so that I didn't even finish the pizza or the popcorn. Or the diet coke I ordered because it was diet, even though I hate pop.
When I entered my food into the tracker later that evening, I discovered that I could've eaten the whole slice of pizza and been all right because I purposefully eat at the lower end of my calorie range, giving me a couple hundred extra calories, just in case.
My point is actually supposed to be that by not making things like pizza "off limits" I can have a single piece without feeling like I've completely ruined any healthy eating I've done to that point. Making it less likely for me to say, "Well, I had one piece, might as well finish the pie!"
But even having 5 slices of pizza isn't the end of the world. It just is. It may slow your progress. It may even cause a gain if it's something you do frequently. But it isn't something you can undo once it's done. So you just accept it and move on with healthier choices next time.