tldr/pages/common/git-reset.md

12 lines
297 B
Markdown
Raw Normal View History

2016-09-26 18:49:39 +01:00
# git reset
> Undo commits or unstage changes, by resetting the current git HEAD to the specified state.
- Undo last commit, keep the changes in the local filesystem:
`git reset HEAD~1`
- Undo last commit, permanently delete the changes, and discard staged changes:
`git reset --hard HEAD~1`