git reset head --soft head code example
Example: "git reset –- soft head^"
git reset --soft HEAD^ #The command to undo a commit and reset to the commit before HEAD and keeping the changes is:
git reset --soft HEAD^ #The command to undo a commit and reset to the commit before HEAD and keeping the changes is: