Back to Skills

github-commit-recovery

Recover deleted commits from GitHub using REST API, web interface, and git fetch. Use when you have commit SHAs and need to retrieve actual commit content, diffs, or patches. Includes techniques for accessing "deleted" commits that remain on GitHub servers.

1,014stars119forksUpdated 1/23/2026

Security Assessment

Medium Risk(65/100)

Detected risks:

Secret Exposure([SKILL.md] token=)
Sensitive File Access([SKILL.md] .env)
Security Score65/100

About github-commit-recovery

The 'github-commit-recovery' skill is designed to help users recover deleted commits from GitHub repositories. By using commit SHAs, this skill enables access to the content, diffs, patches, and metadata associated with these commits, even when they have been force-pushed over. GitHub retains these deleted commits on their servers indefinitely, and this skill provides methods for retrieving them through REST API calls, web interfaces, and git fetch operations. The main purpose of this skill is to ensure that developers and investigators can access valuable commit information, even when it seems to have been erased or replaced.

FAQ

How can I access deleted commits from GitHub?

You can access deleted commits by using their commit SHAs via the GitHub web interface, REST API, or by performing a git fetch operation. Each method provides different ways to retrieve the commit content, diffs, and patches.

What is the maximum number of requests I can make to the GitHub API?

The GitHub API allows 5,000 requests per hour if authenticated. If unauthenticated, you are limited to 60 requests per hour.

Can I retrieve deleted commits with just part of the SHA?

Yes, GitHub allows accessing commits with just 4 or more characters of the SHA, provided they are unique enough to avoid collision.

Are there any limitations when accessing deleted commits through GitHub?

While deleted commits can be accessed, there are rate limits for the GitHub API and web interface. Excessive usage may also trigger throttling or blocking from GitHub's Web Application Firewall (WAF).

Can I recover deleted commits without authentication?

Yes, you can recover deleted commits without authentication using the web interface. However, for API access, authentication is recommended to avoid request limitations.

Install github-commit-recovery

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill