git-undo-wizard

Undo, revert, and recover from common Git mistakes with commands.

5|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/latestaiagents/agent-skills --skill git-undo-wizard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-undo-wizard
Source: https://github.com/latestaiagents/agent-skills/tree/main/plugins/developer-toolkit/skills/git/git-undo-wizard
Command: npx skills add https://github.com/latestaiagents/agent-skills --skill git-undo-wizard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and set of commands to safely undo, revert, or recover from various Git mistakes, preventing data loss and preserving repository integrity.

Core Features & Use Cases

  • Undo Commits: Revert or reset commits, both before and after pushing.
  • File Recovery: Restore accidentally modified or deleted files.
  • Branch Management: Recover deleted branches and undo merges.
  • History Correction: Safely handle sensitive data committed by mistake.

Quick Start

Use the git undo wizard to safely undo the last commit without discarding changes.

Frequently Asked Questions about git-undo-wizard

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

FAQPage Schema
How do I undo a git commit after pushing to a remote repository?

To undo a pushed git commit safely, use `git revert` instead of resetting. This creates a new commit that inverses the changes, preserving repository integrity and avoiding force pushes that can overwrite remote history.

What is the best way to recover deleted files or lost commits in git?

Recover lost commits or deleted files in git by using `git reflog` to track head movement. This command logs historical references, allowing you to checkout or reset to a specific state before the accidental deletion occurred.

How do I undo a git merge or recover a deleted branch?

Undo a git merge or recover a deleted branch by finding the pre-merge state through `git reflog` and resetting your current branch accordingly. This restores your working directory to its previous configuration without discarding local changes.

Can I safely remove sensitive data committed by mistake in git history?

Yes, you can correct git history containing sensitive data. The skill provides strategies to safely handle sensitive data committed by mistake, ensuring the incorrect files are removed while maintaining the rest of your repository structure.

Does `git reset` discard my local changes when undoing an accidental commit?

Using `git reset` can discard local changes depending on the mode used. The skill offers safer strategies to undo the last commit without discarding changes, utilizing specific reset options to preserve your working directory.

When should I use `git revert` instead of `git reset` to fix mistakes?

Use `git revert` for pushed commits to safely rewrite history without affecting collaborators, and `git reset` for local mistakes. The skill emphasizes these safety best practices to prevent data loss and preserve repository integrity.