abandon

Stash uncommitted changes and switch away from an unmerged Git branch.

5|1|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/ai-hero/hero-skills --skill abandon-ai-hero
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: abandon
Source: https://github.com/ai-hero/hero-skills/tree/main/skills/abandon
Command: npx skills add https://github.com/ai-hero/hero-skills --skill abandon-ai-hero

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When work on a feature branch stalls or gets cancelled, developers need a safe way to step away without losing uncommitted changes or accidentally deleting unmerged work. This Skill handles that exit cleanly: it stashes WIP, verifies the branch truly never merged, switches back to the default branch, and resets context. ## Core Features & Use Cases - Safe stash and switch: Detects uncommitted changes, offers to stash them with a labeled message, then checks out the default branch and pulls latest. - Merge-status guard: Checks remote and local merge status before offering deletion, preventing accidental loss of work that was actually squash-merged. - Optional branch cleanup: On explicit confirmation, force-deletes the local branch and optionally closes the open PR and remote branch via the GitHub CLI. - Use Case: A developer starts a ticket, realizes priorities changed, and runs the abandon flow to stash their half-finished work, return to main, and pick up the next task with a clean slate. ## Quick Start Ask the assistant to abandon the current branch and return to the default branch, stashing any uncommitted work first.

Frequently Asked Questions about abandon

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

FAQPage Schema
How do I safely abandon a Git branch with uncommitted changes?

Stash the uncommitted changes with a labeled message like "abandon: WIP on branch-name", then check out the default branch and pull latest. The stash can be restored later with git stash pop, so no work is lost.

How do I delete a local branch that was never merged?

First verify the branch has no merged PR using gh pr list or git branch --merged, then switch to the default branch and run git branch -D to force-delete. Always confirm explicitly since unmerged work is unrecoverable once the ref expires.

What happens if my branch was already squash-merged?

The skill checks merged-PR status remotely via the GitHub CLI and falls back to a local git branch --merged check. If the branch was already merged, it stops and redirects you to the ship-pr cleanup flow instead of treating it as an abandon.

Does abandoning a branch delete the remote branch or open PR?

Not automatically. After local deletion, the skill asks for confirmation before closing an open PR with gh pr close --delete-branch or removing the remote branch with git push origin --delete.

Why does the abandon flow refuse to discard uncommitted changes?

Discarding is destructive and irreversible, so the skill only offers stash or cancel options. A user who truly wants to discard changes can do so manually before running the skill.