Reset
also: git reset, hard reset, reset --hard
Moving your project's history back to an earlier commit. Some kinds of reset permanently delete changes you haven't committed, so treat it with care.
"git reset" moves the current branch to a different commit. --soft keeps the changes staged; the default, --mixed, keeps them in the working tree; --hard discards all uncommitted changes and makes the files match the target commit. Commits after that point drop out of the branch's history.
Rewinding a tape and recording over it. You're back at the earlier point, but whatever came after may be gone.
Agents sometimes suggest "git reset --hard" to clean up. It can erase hours of uncommitted work instantly, with no undo. Know exactly what it will delete before saying yes.
I can run git reset --hard to discard all changes. Warning: this permanently deletes uncommitted edits in 5 files, including yours. Should I stash them first?
Don't use git reset --hard. If you need to undo your changes, list the files first, and stash or commit anything that isn't yours.
Thinking reset is just another word for revert. Revert adds a new undo commit and keeps history. Reset moves history backward and can destroy uncommitted work.