diff --git a/pages/common/git-reset.md b/pages/common/git-reset.md new file mode 100644 index 0000000000..de874f5c94 --- /dev/null +++ b/pages/common/git-reset.md @@ -0,0 +1,11 @@ +# 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`