git-recovery

Recover lost Git commits using reflog and safe reset strategies.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/DaleSeo/git-skills --skill git-recovery-daleseo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-recovery
Source: https://github.com/DaleSeo/git-skills/tree/main/skills/git-recovery
Command: npx skills add https://github.com/DaleSeo/git-skills --skill git-recovery-daleseo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git recovery is essential to prevent data loss when mistakes happen. This skill provides safety-focused strategies to recover lost commits, undo dangerous operations, and preserve work across local and shared branches.

Core Features & Use Cases

  • Reflog-based recovery: Retrieve lost commits or branches using the reflog and recreate branches as needed.
  • Safe undo strategies: Use reset, revert, and stash with guardrails to protect working data.
  • Recovery workflows: Step-by-step guidance for common mistakes (resetting too far, accidental branch deletion, bad merges) and how to recover.

Quick Start

Ask the AI to guide you through recovering a mistaken commit using reflog and safe reset techniques.

Frequently Asked Questions about git-recovery

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

FAQPage Schema
How do I recover lost Git commits after an accidental reset?

To recover lost Git commits after an accidental reset, you can use the git reflog to identify the commit hash and safely recreate the branch using safe reset strategies. This approach applies guardrails to prevent data loss during local recovery.

What is the best way to undo a bad Git merge without losing data?

The best way to undo a bad Git merge without data loss is to use git revert or safe reset strategies alongside reflog checks. This ensures your working data is protected through validation via diffs and operational guardrails.

How does Git reflog work for retrieving dropped commits?

Git reflog works by tracking reference updates, allowing you to retrieve dropped commits by finding their hashes and recreating branches as needed. It serves as a safety backup to recover lost work across local and shared branches.

Can I safely recover an accidentally deleted Git branch on a shared remote?

Yes, you can safely recover an accidentally deleted Git branch on a shared remote by applying reflog-based recovery methods. The process includes validation via diffs and reflog checks to ensure safe operational guardrails across shared branches.

When should I use git revert instead of git reset to undo changes?

You should use git revert instead of git reset to undo changes when working on shared branches to avoid rewriting history. Git reset is better suited for local mistakes with safe guardrails, while revert safely undoes mistaken changes without data loss for others.