Ways to undo changes
git reset --soft HEAD~1
Undo last commit, keep changes staged.
git reset HEAD <path>
Unstage changes for a specific file or files
git checkout -- <path>
Restore a file in the working directory to the version from the current branch or index.
git reset --hard HEAD~1
Undo last commit and discard changes.
git revert <commit>
Revert the changes introduced by a specific commit