recover-git-state

Recover unreachable git objects via reflog and fsck analysis.

9|3|Updated Jun 13, 2026
One-click install
npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill recover-git-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recover-git-state
Source: https://github.com/Sir-chawakorn/sanook-cli/tree/main/skills/recover-git-state
Command: npx skills add https://github.com/Sir-chawakorn/sanook-cli --skill recover-git-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the panic of losing work due to accidental git operations like hard resets, bad rebases, or deleted branches by leveraging git's internal reflog and object database to restore unreachable data.

Core Features & Use Cases

  • Reflog Recovery: Identifies and restores commits lost after destructive operations like reset or rebase.
  • Stash Retrieval: Recovers dropped or popped stashes that are no longer visible in the standard stash list.
  • Regression Pinning: Automates the process of identifying the specific commit that introduced a bug using binary search.

Quick Start

Use the recover-git-state skill to find and restore the lost commits from my recent hard reset.

Frequently Asked Questions about recover-git-state

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

FAQPage Schema
How do I recover lost commits after a git hard reset or bad rebase?

Recover lost commits after a hard reset by inspecting the git reflog to locate unreachable objects, then resetting your branch to the desired state. This skill analyzes reflogs and filesystem snapshots to restore unreachable data.

What is git reflog and how does it help retrieve deleted branches?

Git reflog is a local record of reference updates that tracks unreachable commits. By analyzing reflog entries, this skill identifies and restores deleted branches that are no longer visible in standard branch listings but still exist in the object database.

Can I retrieve a dropped or popped git stash that disappeared from the list?

Yes, retrieve dropped git stashes by analyzing unreachable objects in the local repository. This skill locates lost stashes that are no longer visible in the standard stash list by inspecting the reflog and object database.

What's the best way to find the specific commit that introduced a bug?

Pinpoint the commit that introduced a bug using git bisect, a binary search process across your commit history. This skill automates the regression pinning operation to locate the exact problematic commit within local git repositories.

Does this git recovery approach require any special tools or external dependencies?

This git recovery approach requires no special tools or external dependencies beyond standard git CLI utilities. It operates entirely within local git repositories using built-in reflog inspection, fsck analysis, and binary search capabilities.

When should I avoid trying to recover unreachable git objects locally?

Avoid local git recovery when unreachable objects have been permanently purged by garbage collection. If the reflog has expired or the object database has been pruned, the dropped commits and deleted branches are no longer recoverable through local filesystem snapshots.