Commands.app

git reset

Workflow

Reset current HEAD to specified state

Options & Flags
Available options for this command
--soft

Keep changes staged

--mixed

Keep changes but unstage (default)

--hard

Discard all changes

Examples
Common usage examples

Undo last commit, keep changes

git reset HEAD~1

Undo last commit, discard changes

git reset --hard HEAD~1
Notes
  • Use --hard with caution, it permanently deletes changes
Related Commands
You might also find these useful