Undo

Undo Git commits and uncommitted changes with safety confirmations.

7|1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/julianobarbosa/claude-code-skills --skill undo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Undo
Source: https://github.com/julianobarbosa/claude-code-skills/tree/main/skills/Git-skill
Command: npx skills add https://github.com/julianobarbosa/claude-code-skills --skill undo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and workflows (resource) components.

What problem does it solve?

This Skill provides step-by-step guidance for undoing uncommitted changes, resetting commits, and safely reverting actions in Git.

Core Features & Use Cases

  • Uncommit safely: Soft/hard resets with context.
  • Revert vs. reset: Clear guidance on when to revert vs. rewrite history.
  • Protection: Warnings and confirmations for destructive actions.

Quick Start

Undo the last commit but preserve changes for further edits.

Frequently Asked Questions about Undo

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

FAQPage Schema
How do I undo the last commit without losing my changes?

Use a soft reset to undo your last commit while preserving changes for further edits. This keeps your work staged or unstaged, letting you modify and recommit safely without rewriting history.

What's the difference between reverting and resetting in Git?

Reverting creates a new commit that undoes changes, preserving history and safe for shared branches. Resetting rewrites history by removing commits entirely—use only on local branches before pushing.

How do I safely undo uncommitted changes in Git?

Discard unstaged changes with checkout, or staged changes with reset. The Skill guides which command matches your situation and confirms destructive actions before proceeding.

Can I undo a push to a remote branch?

Yes, but with caution. Use revert to create a new commit undoing changes on shared branches, or reset locally then force-push only on branches you own. The Skill provides warnings for destructive operations.

Why should I use guided undo workflows instead of raw Git commands?

Structured workflows enforce conventional-commit messaging, add security checks, and provide explicit confirmations for destructive actions, reducing mistakes when resetting or reverting changes across commits and branches.

Does this Skill work with GitHub pull requests and branches?

Yes. The Skill integrates with GitHub CLI and supports undo workflows across commits, branches, pull requests, and merges with built-in security checks and conventional-commit enforcement.