git-forensics

Recover lost commits and repair corrupted Git repositories via reflog analysis.

1|Updated Dec 26, 2025
One-click install
npx skills add https://github.com/DammianMiller/universal-agent-memory --skill git-forensics-dammianmiller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: git-forensics
Source: https://github.com/DammianMiller/universal-agent-memory/tree/main/.factory/skills/git-forensics
Command: npx skills add https://github.com/DammianMiller/universal-agent-memory --skill git-forensics-dammianmiller

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a specialized approach to recover data from corrupted Git repositories, retrieve lost commits, analyze reflogs, and perform complex Git repo repairs beyond standard commands.

Core Features & Use Cases

  • Git Recovery: Handles scenarios like corrupted .git directories, lost commits, and broken repository states.
  • Reflog Analysis: Leverages git reflog to find and restore commits that may appear lost.
  • Integrity Checks: Uses git fsck to diagnose repository corruption.
  • Use Case: If you accidentally reset a branch and lost recent work, this Skill can help you trace back through the reflog to recover those commits.

Quick Start

Use the git-forensics skill to recover from a corrupted Git repository by first backing up the .git directory.

Frequently Asked Questions about git-forensics

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

FAQPage Schema
How do I recover lost commits after accidentally resetting a Git branch?

You can recover lost commits after a branch reset by using git reflog to trace previous HEAD positions and restoring the detached commit hashes to a new branch.

What is the best way to repair a corrupted Git repository?

The best way to repair a corrupted Git repository is to first back up the .git directory, then run git fsck integrity checks to diagnose the corruption before applying targeted forensic recovery commands.

How does git reflog work for finding lost work?

Git reflog works by recording reference updates to the repository, allowing you to find lost work by reviewing a chronological log of where branch tips and HEAD have previously pointed.

Can I use git fsck to diagnose a corrupted .git directory?

Yes, you can use git fsck to diagnose a corrupted .git directory by running file system checks that verify object database connectivity and identify dangling or unreachable commits.

Do I need to back up my repository before attempting Git recovery?

Yes, you need to back up your repository before attempting Git recovery, as strict adherence to backup protocols ensures the broken Git state remains intact if forensic repair commands fail.

Why does Git recovery require advanced forensic techniques beyond standard commands?

Git recovery requires advanced forensic techniques beyond standard commands because corrupted .git directories and broken repository states often demand deep reflog analysis and integrity checks that basic Git workflows do not address.