Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 388 Bytes

13-git-reset.md

File metadata and controls

28 lines (20 loc) · 388 Bytes

Reset

To reset the last commit, do:

git reset HEAD

If you are sure and you want to discard the commit, you can do instead:

git reset HEAD --hard

To go back 3 commits:

git reset HEAD~3

To clean up untracked files, do:

git clean -df

With git reset you can go back to previous commits, and create a new branch there.


Next