How to git soft reset last commit
git reset” command with the “–soft” option that will preserve changes done to your files. You have to specify the commit to undo which is “HEAD~1” in this case. The last commit will be removed from your Git history.
git reset --soft HEAD^ // going back to one commit
or
git reset --soft HEAD~1 // equivalent to "^" and going back one commits
When using git reset –soft HEAD~1 you will remove the last 1 commits (previous commit) from the current branch and when you run status the then you will see your changes in the working tree.