Skip to content

Commit

Permalink
Added git.md
Browse files Browse the repository at this point in the history
  • Loading branch information
halyph committed Oct 7, 2023
1 parent d76c6d0 commit ca02eda
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/wiki/howtos/git.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
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

The `--soft` option means that you will not lose the uncommitted changes you may have.

```shell
git reset --soft HEAD~1
```

### hard reset

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
```

0 comments on commit ca02eda

Please sign in to comment.