Git · inspect by default
/git-recover
Investigate reflog and history to recover lost work
Use to find and preserve lost Git content; git-conflicts resolves an active operation.
Make it your own.
In Claude Code, use the slash command and add your context. In Codex, select git-recover from the just-vibe skill picker, then send the same brief.
Version 0.11.0 also supports /jv git-recover, /just-vibe git-recover and /jv:git-recover in Claude. See shortcut setup and context examples.
/just-vibe:git-recover Find a lost commit in reflog without resetting the current branch./just-vibe:git-recover Recover a dropped commit without moving the current branch./just-vibe:git-recover Inspect recovery options after missing reflog history; do not promise restoration./just-vibe:git-recover Find stash entries lost after git stash clear without running garbage collection.What the agent does
- Inspect reflog, refs, stashes and reachable candidates, then unreachable objects with read-only git fsck --unreachable --no-reflogs (stash commits are merge commits titled WIP on or On); avoid commands that may trigger automatic garbage collection until the candidate is preserved.
- Compare candidate file contents and explain confidence.
- In apply mode, when restoration is requested, preserve the chosen commit with a new ref or copy before any active-branch movement.
Inputs
- lost commit/file symptom, approximate event, and repository.
Optional context: scope, references, constraints, successCriteria, environment, mode, budget.
Scope
- Reads
- Find recoverable history and prepare non-destructive restoration; no reset by default.
- Writes
- Inspect/plan: locate candidates and describe restoration steps without writing. Apply: create only a new preservation ref (branch or tag) for the chosen content, or a copy of a recovered file outside tracked paths; never move the active branch, reset, rewrite history or run garbage collection.
- Mode
- Inspect; lost commit/file symptom, approximate event, and repository. Restoring uses apply mode and writes only a new preservation ref.
- Prerequisites
- Git, exact repository/worktree, and readable refs/index. Record branch, HEAD, staged/unstaged/untracked state before mutation. Preserve unrelated edits and never default to broad staging, hard reset, clean, force push, or history rewriting.
Expected output
- Candidate identities with confidence, exact preservation/restoration steps or the recovered location, and the preserved current state.
How the work is checked
- A lost commit can be preserved without moving the active branch; absent recovery evidence is not claimed as recoverable.
When to stop or clarify
- Do not run garbage collection or destructive cleanup during recovery. Preserve current work before any authorized restore.
Handling missing context
- Infer
- Read repository root, HEAD, branch, refs and staged/unstaged/untracked distinctions; use the configured human identity.
- Assume
- Limit an ambiguous inspection to the current repository and report that scope; preserve all existing changes.
- Ask
- Before mutation, resolve uncertain commit membership, destination ref or history-rewrite intent; do not ask again about already authorized exact actions.
Technical guidance
- Evidence
- Inspect reflogs, stashes, reachable refs, unreachable objects from git fsck and candidate object contents before changing active refs.
- Method
- Preserve a verified candidate with a new branch or copy, then explain how it differs from current work.
- Pitfall
- Reflogs expire and may not exist for another clone; garbage collection can remove the very objects being recovered.
- Check
- Verify the recovered tree contains the requested content and leaves the original branch, index and worktree recoverable.
Situational decisions
When the candidate is absent after the reflog, ref, stash and unreachable-object search: State the recovery limit only then, and avoid cleanup that could reduce recoverability.
The coding agent follows this workflow using its available tools. Installation does not grant service access or guarantee an outcome. Read the compatibility notes.