From 1723799157196966c86d4638abf1ff84135bc758 Mon Sep 17 00:00:00 2001 From: Orest Ivasiv Date: Fri, 13 Oct 2023 11:58:25 +0200 Subject: [PATCH] upd git.md --- docs/wiki/howtos/git.md | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/docs/wiki/howtos/git.md b/docs/wiki/howtos/git.md index 903c278..3de5091 100644 --- a/docs/wiki/howtos/git.md +++ b/docs/wiki/howtos/git.md @@ -3,32 +3,13 @@ tags: - git --- -[git-reset]: https://www.freecodecamp.org/news/git-revert-commit-how-to-undo-the-last-commit/ "Git Revert Commit – How to Undo the Last Commit" - # git ## Undo the Last Commit -[Source][git-reset] - -### soft reset - -??? note - - The `--soft` option means that you will not lose the uncommitted changes you may have. - -```shell -git reset --soft HEAD~1 -``` - -### hard reset - -??? note - - If you want to reset to the last commit and also remove all unstaged changes, you can use the `--hard` option - ```shell -git reset --hard HEAD~1 +git reset --soft HEAD~1 # you won't lose the uncommitted changes you may have +git reset --hard HEAD~1 # also remove all unstaged changes ``` ## Deleting a remote branch