You can’t undo what’s done.
What’s happened has happened, and there’s no going back.
Time only moves forward.
The best thing you can do is learn from the experience, and choose differently going forward.
If you could undo the whole thing you wouldn’t benefit from the lesson.
So, it works out for the best anyway.