Skip to content
This repository was archived by the owner on Jan 22, 2024. It is now read-only.

Latest commit

 

History

History
executable file
·
26 lines (18 loc) · 546 Bytes

File metadata and controls

executable file
·
26 lines (18 loc) · 546 Bytes

git reset

Reference docs

In the first and second form, copy entries from to the index. In the third form, set the current branch head (HEAD) to , optionally modifying index and working tree to match. The / defaults to HEAD in all forms.

Modes of reset

git reset --soft HEAD~2
git reset HEAD~
git reset --hard <commit-SHA>

Removing items from the staging area

git reset -- <filename>

Reset across merge commits

git reset --hard HEAD~^
git reset --hard HEAD~^2