git:reflog-recover

git:reflog-recover is a command for Claude Code from geoffjay/claude-plugins. It costs 23 tokens per session (4,934 once invoked), scanned A, original, MIT.

A Git command that uses the reflog, Git’s local record of movements such as resets, rebases, merges, and branch deletions, to find and recover lost work.

In plain words
What is it for?
Use it to inspect recent repository movements, recover lost commits or branches, or create a new branch from recovered work.
Why use it?
It can help undo mistakes such as deleting a branch or running a hard reset that removed commits from normal branch history.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: positional $N argument.

Good fit Use it to inspect recent repository movements, recover lost commits or branches, or create a new branch from recovered work.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/geoffjay/claude-plugins/reflog-recover
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/geoffjay/claude-plugins

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for git:reflog-recover

README.md
[![agentmods](https://agentmods.dev/badge/commands/geoffjay/claude-plugins/reflog-recover/github.svg)](https://agentmods.dev/commands/geoffjay/claude-plugins/reflog-recover)
Your own site
<a href="https://agentmods.dev/commands/geoffjay/claude-plugins/reflog-recover"><img src="https://agentmods.dev/badge/commands/geoffjay/claude-plugins/reflog-recover/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for git:reflog-recover

Your own site · 80×15
<a href="https://agentmods.dev/commands/geoffjay/claude-plugins/reflog-recover"><img src="https://agentmods.dev/badge/commands/geoffjay/claude-plugins/reflog-recover.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 23 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,934 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00023 $0.04934
Opus 5.5 $0.00009 $0.01974
Sonnet 5.5 $0.00005 $0.00987
Haiku 4.5 $0.00002 $0.00493

Measured 1mo ago against content hash 3327f28d3c3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

git:reflog-recover scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/utilities/git/commands/reflog-recover.md · 775 lines

How it starts

The opening of the file, as written. The whole thing — 775 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Git Reflog Recover - Lost Commit and Branch Recovery

Use reflog to recover lost commits, deleted branches, and resolve repository mistakes.

Command

/git:reflog-recover [search-term] [action]

Arguments

  • $1: search-term - Text to search in reflog (optional, shows recent reflog if omitted)
  • $2: action - show|recover|create-branch (default: show)

Description

Git's reflog (reference log) tracks every change to branch tips and HEAD, even changes that "lose" commits like hard resets, branch deletions, or rebases. The reflog is your safety net for recovering from mistakes, finding lost work, and understanding repository history.

What is Reflog?

The reflog records:

  • Every commit
  • Branch switches
  • Resets (soft, mixed, hard)
  • Rebases
  • Merges
  • Amends
  • Cherry-picks
  • Branch deletions
  • Any HEAD movement

Each entry shows:

  • Commit hash
  • Previous HEAD position
  • Action performed
  • When it happened

Important: Reflog entries expire after ~90 days by default. Recovery is not possible after expiration.

When to Use Reflog Recovery

  • Accidentally deleted a branch
  • Did git reset --hard and lost commits
  • Messed up rebase and want to undo
  • Amended commit but want old version
  • Lost commits after force-push
  • Want to see what you were working on
  • Need to understand what happened
  • Recover from any git mistake

What Can Be Recovered

Can Recover:

  • Committed changes (within ~90 days)
  • Deleted branches (if committed)
  • Reset commits
  • Rebased commits (old versions)
  • Amended commits (previous versions)
  • Cherry-picked commits (originals)

Cannot Recover:

  • Uncommitted changes (never committed)
  • Changes that were never staged
  • Expired reflog entries (>90 days old)
  • Changes from other users' local repos

Workflow

Show Reflog

  1. Display recent reflog:

    git reflog show
    

    Or with limits:

    git reflog show -n 50
    
  2. Format reflog entries:

    • Show commit hash (short and full)
    • Show reflog reference (HEAD@{n})
    • Show action performed
    • Show relative time (5 minutes ago, 2 days ago)
    • Show commit message

Read the full file on GitHub · 775 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 775 lines · 23 tokens per session scan A 3327f28d3c3c

Subscribe to this mod's changes

git:reflog-recover is a command published in the GitHub repository geoffjay/claude-plugins (8 stars, last pushed 11mo ago), licensed MIT. It adds 23 tokens to every session and 4,934 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.