# git reset: soft, mixed, hard — Git

Source: https://www.geekswithgeeks.com/en/git/git-reset-modes

> Move a branch pointer backward, with three levels of blast radius.

## The three flavors

`--soft` keeps changes staged, `--mixed` (default) keeps them unstaged, `--hard` discards them entirely.

```bash
git reset --soft HEAD~1    # undo commit, keep changes staged
git reset HEAD~1           # undo commit, keep changes unstaged
git reset --hard HEAD~1    # undo commit AND discard changes
```

## --hard is destructive

`git reset --hard` permanently deletes uncommitted work. Double-check `git status` before running it — there's no confirmation prompt.

**Quiz:** Which reset mode discards changes entirely?

- [ ] --soft
- [ ] --mixed
- [x] --hard

*Answer:* --hard. --hard resets both the commit history and the working directory, deleting uncommitted work.
