reset-flow

Enforces gated, recoverable git reset operations with safety branches and approval checkpoints.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill reset-flow-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reset-flow
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/reset-flow
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill reset-flow-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Git reset can silently destroy work: it detaches commits from a branch and, with --hard, permanently deletes uncommitted changes with no recovery path. This Skill turns every reset into a gated workflow so nothing is lost without explicit user approval and a recovery branch in place. ## Core Features & Use Cases - Deterministic risk analysis: The reset-context.sh script reports which commits will leave the branch, whether any are already pushed (requiring force-push), and which uncommitted files a --hard reset would destroy, flagging BLOCKER conditions like protected branches, detached HEAD, or in-progress rebase/merge operations. - Approval and arm gates: A structured reset plan must be presented and explicitly approved before execution; reset-arm.sh then creates a timestamped backup/reset/<branch> safety branch and a 30-minute unlock marker required by the bundled git-guard hook, which mechanically blocks any unarmed git reset. - Safer alternatives first: The workflow directs unstage requests to git restore --staged, file discard to git restore, and pushed-commit undo to git revert, reserving reset for actual HEAD/branch-pointer moves. - Use Case: After a failed rebase, you need to return to the backup branch. The Skill collects context, shows exactly what will be lost, creates a safety branch, arms the guard, executes the approved command verbatim, and verifies HEAD matches the target. ## Quick Start Ask the assistant to reset the current branch to a target ref such as backup/rebase/my-feature with a chosen mode, and follow the presented plan to approve and execute it safely.

Frequently Asked Questions about reset-flow

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

FAQPage Schema
How do I safely undo commits with git reset?

Run the reset-context.sh script with your target ref and mode to see which commits leave the branch and whether any are pushed. Then present the plan for approval, run reset-arm.sh to create a safety branch, and execute the approved reset command.

How to recover after git reset --hard deleted my changes?

Commits detached by reset are recoverable from the safety branch created by reset-arm.sh or from the reflog. Uncommitted changes destroyed by --hard are not recoverable, which is why the workflow requires explicit approval and a file list before allowing dirty resets.

What is the difference between git reset --soft, --mixed, and --hard?

Soft moves only HEAD, keeping changes staged; mixed unstages changes but keeps them in the working tree; hard discards both staged and unstaged changes permanently. The reset-context.sh script reports the impact of whichever mode you specify.

Why is my git reset blocked by the git-guard hook?

The bundled PreToolUse hook denies any git reset that lacks a valid unlock marker. Run reset-arm.sh after plan approval to create the safety branch and the 30-minute marker that lets the reset pass the guard.

When should I use git revert instead of git reset?

Use git revert when the commits you want to undo are already pushed, since it creates new inverse commits without rewriting history. Reset of pushed commits requires a force-push afterward, which the workflow flags as a WARNING.

Can I run git reset on the main branch with this workflow?

No. Protected branches such as main, master, develop, trunk, and release branches are BLOCKER conditions, and reset-arm.sh refuses to arm on them. Resets are only permitted on working branches.