What problem does it solve? Deleting local commits or resetting branches with git is irreversible when commits were never pushed, and requests like "delete local commits" are ambiguous between hard resets, merge aborts, and rebases. This Skill prevents irreversible data loss by enforcing state detection, remote-backup verification, and explicit intent confirmation before any destructive git command runs. ## Core Features & Use Cases - Pre-destruction state detection: Runs git status, git branch -vv, and rev-list --left-right --count to determine divergence, in-progress merges, staged changes, and whether local commits exist on a remote backup. - Intent disambiguation: Presents concrete options (hard reset to origin, abort merge and keep commits, or rebase onto remote) with recovery paths stated, never a bare yes/no. - Rebase-merge branch cleanup: Handles branches that appear unmerged after rebase-and-merge or squash-merge PRs by verifying content landed on main before force-deleting SHA-rewritten branches. - Use Case: A user says "放弃这些提交" on a diverged branch with an in-progress merge. The Skill detects the merge state, checks whether the 3 local commits were pushed, warns that staged changes will be destroyed, and only executes git reset --hard origin/main after the user picks that option explicitly. ## Quick Start Ask the agent to delete your local commits or reset your branch to origin, and it will verify the state and confirm your intent before running anything destructive.