Reset Branch — Git skill for Claude Code
Switch to main and delete previous branch.
How to install Reset Branch
Installs to ~/.claude/commands/lindsey-anthropic-meridian-workshop-reset-branch.md
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:
- Check current branch with
git branch --show-current - If already on main/master, inform user no reset needed
- 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
- Show commits to be lost:
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 RepositoryRelated Skills
Clean After Merged
Switch to the repo's main branch, pull, and delete the just-merged local branch.
Dip
Post-merge cleanup — switch to base branch, pull latest, delete the merged feature branch, restore any stash.
Git Switch To Main
Switch to the main branch and pull the latest changes.
Vmctl
Agent skill to control VMware Workstation VMs via vmrun: power on/off, start, stop, suspend, reset, guest IP,
Foxel RmShield
Foxel rmShield: a Claude Code mod that holds risky shell commands (rm -rf, git reset --hard, force push, migra
PR Merged
Post-merge cleanup — checkout main, pull latest, delete the feature branch, and close the linked work item.
Related Agents
Lane Manager
Starts, resumes, parks and finishes lanes (branch + worktree + registry file) in the control plane. Use when t
Merger
Reviews, validates, and merges arc-agents PRs. Sole authority for destructive git ops (rebase, push, merge, br
Cleanup Phase 1
Runs phase 1 (dead code) and phase 1.5 (duplicate functions) of a codebase cleanup that is already under way.