Git History Detective

    1

    Git recovery and history help: recover lost commits, undo a bad commit or merge safely, find who changed a line, and find the breaking commit with bisect. Safe by default, with a way back for every step.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Git History Detective

    Example session with this skill installed

    I ran a reset on my feature branch and three commits are gone. The branch was never pushed. Here is my reflog output.

    • Read your context and instructions
    • Compiled the git history detective

    Illustrative. The situation and the reflog output are invented; this shows the structure and depth the skill produces.

    What I found

    • The branch is local only and not shared, so recovering it does not affect anyone else.
    • The reflog shows the branch pointing to a91c3f2 before the reset and to 4be07d1 after it, so the three commits are still reachable by hash.

    Recommended steps (in order)

    1. Read-only: confirm what the lost commits contain.

      git log --oneline 4be07d1..a91c3f2
      

    Expected: the three commit titles you remember.
    2. Create a safety branch at the old tip (changes nothing in your working tree).

    git switch -c rescue/feature-before-reset a91c3f2
    

    Undo: delete this branch later; the commits are safe on it.
    3.

    Decide where you want the work. If the three commits are what you want on your feature branch, move the feature branch back to them:

    git switch feature
    git reset --keep a91c3f2
    

    This refuses to run if it would overwrite local changes, which is the safe behaviour. If it refuses, commit or stash your current changes first.
    4. Check the result.

    git log --oneline -5
    git status
    

    Expected: your three commits at the top, a clean working tree.

    Step flags

    StepType
    1read-only
    2creates a branch (no history rewrite)
    3moves the branch pointer (history change, local only)
    4read-only

    The way back

    If step 3 is not what you wanted, switch back to rescue/feature-before-reset or point the feature branch at 4be07d1 again. The reflog keeps both positions.

    What I could not determine

    • Whether anything other than the three commits was lost (uncommitted work is not in the reflog).
    • Your git version, which can affect the wording of messages but not these commands.

    Next steps

    • Run step 1 and tell me what it prints before you run step 3.
    • Once the work is back, push the branch or keep the safety branch until you are sure.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Fix git problems without losing work. Describe what happened (lost commits, a bad merge, a broken build, a line nobody understands) and it classifies the situation, reads before it writes, and gives the safest command sequence with what each command changes and how to undo it. It covers recovering lost commits and branches through the reflog, undoing a commit or merge (revert for shared history, reset for local), finding who changed a line and why (blame that ignores whitespace and follows moved code, history search for a string), finding the commit that broke something with bisect, and tidying local commits before a pull request.

    What makes it different from a generic prompt: a fixed safety protocol. Information-only commands come first. A safety branch is created before any history rewrite or discard. Shared history is never rewritten without the team's agreement. A hard reset or forced cleanup is never proposed without a clean or saved working tree and your explicit yes. Every step is flagged as read-only, working-tree change or history change, and has its way back.

    What it reads and does: it explains and lists git commands. If your agent can run git, it uses read-only commands first and asks before anything that changes history. It makes no network connection of its own.

    Honest limits: it cannot see your repository unless commands are run and the output shared, and it cannot recover objects git has already removed. Options can differ between git versions.

    Cannot see your repository unless commands are run and their output shared, and cannot recover objects git has already removed. Options and messages can differ between git versions.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 13 days ago

    Requires

    git

    Permissions

    Terminal / Shell

    File Scopes

    <the
    repository
    you
    name>

    A prompt-only skill (SKILL.md). If your agent can run git, it uses read-only git commands first and asks before anything that changes history; the skill itself makes no network connection and reads no environment variables.

    Listed13 days ago

    What's inside

    Frequently Asked Questions

    No. It starts with information-only commands, creates a safety branch before any history rewrite or discard, never rewrites shared history without your team's agreement, and does not propose a hard reset or forced cleanup without a clean or saved working tree and your explicit yes.

    Usually, yes: the reflog keeps the positions of HEAD and branches, so a lost commit can normally be found by its hash and put on a new branch. It cannot recover objects git has already removed after its retention period.

    Yes. For shared branches it uses a revert, which adds a new commit instead of rewriting history. It only suggests rewriting shared history if the whole team agrees, and then with the lease form of a force push.

    Yes. It guides a bisect: define a quick pass or fail test, mark a known bad and a known good commit, skip commits that cannot be tested, and verify the result. It reminds you that bisect moves HEAD, so uncommitted work must be saved first.

    New in DevOps & Cloud