Reset Helper
Git reset helper online. Understand soft, mixed, hard reset with visual diagrams. Generate reset commands safely—free Git tool.
Git reset rewrites history. Use with caution on shared branches!
🔧 Reset Type
📊 What Gets Affected
| Working Directory | Staging Area | HEAD | |
|---|---|---|---|
| 🟢 Soft Reset | ✓ Kept | ✓ Kept | ↩ Moved |
| 🟡 Mixed Reset | ✓ Kept | ✗ Reset | ↩ Moved |
| 🔴 Hard Reset | ✗ Reset | ✗ Reset | ↩ Moved |
Visual Explanation
📁
WorkingDirectory Safe
📋
StagingArea Reset
🔖
HEADPointer Moved
Reset Target
🟡 Command
git reset --mixed HEAD~1💡 When to Use Mixed Reset
Undo commit and unstage changes
Example: Split a commit into smaller ones
↩️ How to Undo
git reset HEAD@{1} # undo last reset⚠️ Safety Tips
- • Never use
--hardon shared branches - • Use
git reflogto recover from mistakes - • Consider
git revertfor shared branches instead - • Always commit or stash changes before resetting
Features
- Visual guide to Soft, Mixed, and Hard resets
- Interactive state simulation
- Generate safe reset commands
- Undo guide (Reflog)
Common Use Cases
- Unstaging files
- Undoing the last commit but keeping changes
- Completely wiping local changes to match remote
Git Reset
Git Reset moves the `HEAD` pointer to a specific state. It is powerful but can be destructive.
- --soft: Moves HEAD, keeps staging and working directory (safest).
- --mixed: Moves HEAD, resets staging, keeps working directory (default).
- --hard: Moves HEAD, resets staging and working directory (destructive).
Examples
Valid - Undo last commit (keep work)
git reset --soft HEAD~1 Valid - Unstage file
git reset HEAD <file> Valid - Hard Reset (Danger)
git reset --hard origin/mainFrequently Asked Questions
Can I undo a hard reset?
Sometimes! Check `git reflog` immediately. If the commit wasn't garbage collected, you can reset back to it.
Difference vs Revert?
`reset` changes history (don't do on shared branches). `revert` creates a new commit that undoes changes (safe for shared branches).
💡 Tips
- Always run `git status` before resetting to know where you are.
- Never `git reset --hard` unless you are 100% sure you don't need your local uncommitted changes.