Quick Actions
git reset
Description
Reset current HEAD to the specified state.
Command
git reset
Examples
Soft reset (keep staged)
git reset --soft HEAD~1
Mixed reset (keep unstaged)
git reset --mixed HEAD~1
Hard reset (discard all)
git reset --hard HEAD~1
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
--soft |
string | No | Keep changes in staging area |
--mixed |
string | No | Keep changes in working directory |
--hard |
string | No | Discard all changes |
--keep |
string | No | Keep local changes |
Command Info
Category:
Undoing
Type:
Git
Views:
7
Status:
Active
Tags
reset
undo
revert