mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-06-05 20:26:05 +02:00
11 lines
297 B
Markdown
11 lines
297 B
Markdown
# 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`
|