git-rollback

Rolls back Git branches to historical commits via interactive reset or revert with confirmation safeguards.

1|Updated Sep 11, 2026
One-click install
npx skills add https://github.com/lldwb/lldwb-claude-skills --skill git-rollback-lldwb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-rollback
Source: https://github.com/lldwb/lldwb-claude-skills/tree/main/skills/git-rollback
Command: npx skills add https://github.com/lldwb/lldwb-claude-skills --skill git-rollback-lldwb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Rolling back a Git branch to a previous commit or tag is risky: reset rewrites history, force pushes can break collaborators, and mistakes are hard to undo. This Skill provides a safe, interactive rollback workflow that previews every command before executing, creates backup branches, and requires explicit user confirmation for destructive operations. ## Core Features & Use Cases - Interactive rollback flow: Lists branches and recent versions (git log, tags, reflog), then lets the user pick the branch, target revision, and mode (reset or revert) before anything executes. - Dry-run by default: Prints the full command sequence without executing; reset operations require explicit confirmation and automatically create a timestamped backup branch first. - Protected branch safeguards: Extra confirmation for main, master, release/*, and production branches; never force-pushes or pushes automatically, only suggests commands for the user to run. - Use Case: A bad commit was pushed to a release branch. Use this Skill to preview a revert plan, confirm the reverse commits, and roll back safely while keeping history intact for collaborators. ## Quick Start Ask the assistant to roll back the branch release/v2 to tag v2.0.5 using revert mode with a dry-run preview first.

Frequently Asked Questions about git-rollback

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

FAQPage Schema
How do I roll back a Git branch to a previous commit safely?

Use an interactive rollback flow that lists branches and recent history, then previews the exact commands before executing. Prefer revert mode, which creates reverse commits and preserves history, over reset, which rewrites history and requires a backup branch first.

What is the difference between git reset and git revert for rollback?

git reset --hard moves the branch pointer and rewrites history, requiring a force push that can break collaborators. git revert creates new reverse commits, keeps history intact, and works with a normal push, making it the recommended choice for shared branches.

Can I undo a git reset --hard after rolling back?

Yes, if a backup branch was created before the reset. This workflow creates a timestamped backup branch at the original HEAD, so you can restore with git reset --hard backup/<branch>-<timestamp>.

Does this rollback workflow push changes to the remote automatically?

No. It never pushes or force-pushes automatically. After a rollback it only suggests the appropriate command, such as git push --force-with-lease for reset or a normal push for revert, leaving execution to the user.

When should I not use git reset to roll back a branch?

Avoid reset on shared or protected branches like main, master, or release branches, since rewriting history breaks collaborators who already pulled. Use revert instead, and avoid history cleanup operations like reflog expire or filter-repo unless explicitly approved.