So what can you learn from this episode? If you want it not to happen again, you need to work out why it happened this time.
I'd suggest a number of factors - if you'd given up booze, why did a friend get you a bottle of wine as a present? Is it because you haven't been open about giving up and (to some extent) why? Making it public is powerful. It gives you accountability that you can otherwise avoid.
Second, why did you keep the wine in the house? Even if at some point you intended to drink it, let's say share it with a good friend over the course of a couple of nights when it wasn't going to be used as a crutch, realistically keeping it out of the house where you had to ask someone else for it before you could drink it would be useful.
Third, the warning signs were already there that you were likely to fall off the wagon. Listen to your triggers, prepare for it. Stay mindful that the craving could hit, have strategies.
Is it fun to have to think about not drinking booze nearly as actively as you once used to think about drinking it? No. But you have to keep actively opposing it.
Two years is a great achievement, and what happened to you could happen to literally any of us, there's no room for complacency. Spending too long brooding on the mistake will be harmful, but not taking the lessons from it will be harmful too.
Pick yourself up and dust yourself off this morning. Recognise the 'logic' that could make your brain say: well, you've slipped once. You feel awful anyway so why not drink again? Stay on guard and keep going.