git revert would have been my first answer, but I have worked for places that did not use git. In that case we had to rely on manual backups we uploaded via the fttp. Having learned that lesson a version control system is a much better option.
Understand the current impact, and rollback the commit if possible (as mentioned above). This isn’t always possible. If the changes have made irreversible changes to the system. For example if the commit created breaking changes to the database, it means you might be better off “patching” things and moving forward.
Identify how this change go into the system via a blameless postmortemThis is not about accusing people, it’s about understanding what part of the overall software development process needs to be changed to prevent this from happening again.
Take steps to prevent this from happening again.
Dealing with mistakes is another thing, blaming people for their mistakes is an even worse thing, but doing something to help prevent these mistakes in the future is a key step to stabilize things moving forward.
Mistakes happen, people are human, and over time systems get more complex so the last thing you want is to just “move on and be more careful” because at some point you’ll find your walking through a minefield of technical debt and if your process isn’t continually improved upon, you’ll find project speed will grind to a halt, or even start going backwards!