![git](https://i0.wp.com/ibexoft.com/wp-content/uploads/2021/12/gitundo.png?fit=768%2C288&ssl=1)
How to undo the last git commit?
There are situations where you just committed a change in git and just after that realized you made a mistake in the last commit. If you haven't pushed that code then the last local changes can be undone with this command.