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.