Command

git reset

Commit-level reset moves HEAD and, if attached, its branch. Soft keeps index/worktree, mixed resets index, hard resets both and can destroy work. Path form only changes index entries. Use disposable fixtures.

Formal Syntax & Structure

git syntaxgit
git reset [--soft | --mixed | --hard] REV

Working Example

Example Snippetgit
git reset HEAD -- notes.txt
Git Reference