lindsey-anthropic

Reset Branch — Git skill for Claude Code

Git community

Switch to main and delete previous branch.

How to install Reset Branch

Installs to ~/.claude/commands/lindsey-anthropic-meridian-workshop-reset-branch.md

Terminal
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/lindsey-anthropic/meridian-workshop/HEAD/.claude/commands/reset-branch.md -o ~/.claude/commands/lindsey-anthropic-meridian-workshop-reset-branch.md

Restart Claude Code, or start a new session, for it to be picked up.

What Reset Branch does


description: Switch to main and delete previous branch

Switch back to main branch and delete the branch you were on, discarding all commits and changes. Also closes any upstream pull requests for the deleted branch.

Steps:

  1. Check current branch with git branch --show-current
  2. If already on main/master, inform user no reset needed
  3. If on feature branch:
    • Show commits to be lost: git log main..HEAD --oneline
    • Store the branch name
    • Use GitHub MCP to find and close a

Alternatives in Git

  • Ws Reset — Reset the current branch to main, fetch upstream, and update submodules 38.1k ★
  • OSS PR — Commit + PR workflow for open source contributions: auto-creates a user-prefixed branch when on main/master, t 19.7k ★
  • Merge Command — Finalize worktree work: update docs, commit, merge to main, clean up 1.3k ★

Full documentation available on GitHub

View Source Repository