--soft keeps the index and files, --mixed (default) resets the index but keeps files, --hard resets both, so uncommitted edits are lost. Use reflog to find the old position.
git reset
Moves the current branch to another commit; the mode decides what happens to the index and working tree.