TL;DR
git reset
resets Staging to the last commit. Use--hard
to also reset files in your Working directory to the last commit.
LONGER VERSION
But that's obviously simplistic hence the many rather verbose answers. It made more sense for me to read up on git reset
in the context of undoing changes. E.g. see this:
If git revert is a “safe” way to undo changes, you can think of git reset as the dangerous method. When you undo with git reset(and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo. Care must be taken when using this tool, as it’s one of the only Git commands that has the potential to lose your work.
From https://www.atlassian.com/git/tutorials/undoing-changes/git-reset
and this
On the commit-level, resetting is a way to move the tip of a branch to a different commit. This can be used to remove commits from the current branch.
From https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting/commit-level-operations