github-commit-recovery

Retrieve deleted GitHub commit content, diffs, or patches via REST API, web, or git fetch.

3.5k|556|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/gadievron/raptor --skill github-commit-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: github-commit-recovery
Source: https://github.com/gadievron/raptor/tree/main/.claude/skills/oss-forensics/github-commit-recovery
Command: npx skills add https://github.com/gadievron/raptor --skill github-commit-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill enables investigators and developers to recover actual commit content from GitHub when commits appear deleted, are orphaned, or were force-pushed away.

Core Features & Use Cases

  • REST API access to commit data, including full content, diffs, and metadata.
  • Web interface access to deleted commits via predictable URLs.
  • Git-based retrieval to fetch exact commit objects and associated files for verification.
  • Use case: recover a patch or file changes from a commit that was rewritten or removed from branches.

Quick Start

Use the github-commit-recovery skill to fetch a known commit SHA from a repository and review its patch or file contents.

Frequently Asked Questions about github-commit-recovery

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

FAQPage Schema
How do I recover a deleted GitHub commit using its SHA?

Recover deleted commits by querying GitHub's REST API with a known commit SHA to retrieve full content, diffs, and metadata. Use curl to fetch `/repos/{owner}/{repo}/commits/{sha}` or git fetch to retrieve the commit object directly, even if it's been force-pushed or orphaned from all branches.

Can I access a GitHub commit that was force-pushed away?

Yes. Force-pushed commits remain recoverable through GitHub's REST API and Git's object database if you know the commit SHA. Access the commit via predictable API endpoints or use git fetch with the SHA to verify and extract the exact commit content and file changes.

What's the best way to fetch a commit patch after it's been removed from branches?

Use GitHub's REST API to retrieve the commit patch directly, or fetch the commit object via Git using its SHA. Both methods work for orphaned commits; the REST API returns formatted diffs and metadata, while git fetch retrieves the raw commit object for verification.

Do I need special tools to recover GitHub commits?

Commit recovery requires standard tooling: curl or an HTTP client for REST API queries, Git for object retrieval, and basic scripting to parse responses. No specialized dependencies are needed; GitHub rate limits apply to API calls.

How do I verify a recovered commit's authenticity and contents?

Retrieve commit metadata, diffs, and file contents via REST API or git fetch, then cross-check the SHA and parent references. The API returns full diffs and patch format; Git's object database provides cryptographic verification through SHA integrity.

What happens when a commit is deleted—can GitHub API still access it?

Deleted commits remain accessible via GitHub's REST API and Git's object store if the SHA is known. Commits are orphaned (unreachable from branches) rather than truly deleted; API endpoints and git fetch still retrieve them with full content and metadata intact.