link
Reset current HEAD to the specified state
git reset
Undo last commit, keep changes
git reset HEAD~1
Undo last commit and discard changes
git reset --hard HEAD~1
Unstage file
git reset file.txt