git-reset

Guides and executes Git undo operations including reset, revert, restore, and stash.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng --skill git-reset-velkaressiablutkrone
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-reset
Source: https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng/tree/main/.claude/skills/git-reset
Command: npx skills add https://github.com/VelkaressiaBlutkrone/spring-python-llm-exam-mng --skill git-reset-velkaressiablutkrone

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Undoing changes in Git is confusing because reset, revert, restore, and stash each behave differently, and choosing the wrong command can permanently destroy work. This Skill diagnoses your current repository state, clarifies what you want to undo, and executes the safest appropriate Git command. ## Core Features & Use Cases - Situation Diagnosis: Runs git status, git log, and git stash list in parallel to understand the current repository state before acting. - Scenario-Based Undo: Handles six scenarios including discarding file changes, unstaging, undoing the last commit (soft/mixed/hard), reverting pushed commits, stashing work, and restoring stashes. - Safety Guardrails: Requires explicit confirmation before destructive commands like git reset --hard, warns about force-push risks on pushed commits, and suggests backups first. - Use Case: You accidentally committed a broken file and already pushed it. The Skill recommends git revert instead of reset to preserve history and avoid force-pushing. ## Quick Start Ask the assistant to undo your last commit or cancel your current changes, for example by saying "취소해줘" or "undo my last commit".

Frequently Asked Questions about git-reset

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I undo my last Git commit without losing changes?▼

Use git reset --soft HEAD~1 to undo the commit while keeping changes staged, or git reset --mixed HEAD~1 to keep changes unstaged. Both preserve your file contents; only the commit itself is removed.

What is the difference between git reset and git revert?▼

git reset removes commits from history and is suited for local commits not yet pushed. git revert creates a new commit that reverses a previous one, preserving history, making it the safe choice for commits already pushed to a shared remote.

How do I unstage files after git add?▼

Run git restore --staged <file> to unstage a specific file, or git restore --staged . for all files. This only removes files from the staging area; your actual file changes remain untouched.

When should I use git stash instead of committing?▼

Use git stash when you have uncommitted work but need a clean working directory, such as before switching branches. Restore it later with git stash pop, or git stash apply to keep the stash entry.

Can git reset --hard changes be recovered?▼

Changes discarded by git reset --hard are generally unrecoverable since both staged and working directory modifications are deleted. The Skill requires explicit user confirmation and suggests creating a backup branch or stash before running it.