One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill git-expert-cogni-ai-ou
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: git-expert
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/git-expert
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill git-expert-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you recover from destructive or confusing Git states, locate regressions, and perform advanced history operations without permanently damaging your repository.

Core Features & Use Cases

  • Reflog Recovery: Restore lost commits or undo harmful actions like bad hard resets by resetting or creating branches from reflog entries.
  • Regression Hunting via Bisect: Use binary search to pinpoint the commit that introduced a bug using git bisect good/bad marking.
  • Complex Conflict & Repository Repair Guidance: Diagnose and repair issues such as corrupted refs, empty/bad objects, broken index/HEAD, and detached HEAD mistakes.
  • History Manipulation & Advanced Cherry-Picking: Apply specific commits or ranges across branches with controlled staging/selection.
  • Use Case: Your team reports a regression after a risky change and your local state looks inconsistent; use this Skill to identify the bad commit and recover a known-good workflow.

Quick Start

Ask an AI to help you recover a lost branch using git reflog and then verify the restored state with git status and git log.

Frequently Asked Questions about git-expert

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

FAQPage Schema
How do I recover a lost commit after a bad hard reset in git?ā–¼

To recover a lost commit after a bad hard reset in git, use git reflog to locate the previous HEAD position and restore it by creating a new branch or resetting your current branch back to that reflog entry, verifying the restored state with git status.

What is the best way to find which commit introduced a regression using git bisect?ā–¼

Git bisect is a binary search mechanism that pinpoints the exact commit that introduced a regression by marking known good and bad commits, systematically checking out intermediate states until the problematic change is identified.

How do I repair a corrupted git repository with broken refs or bad objects?ā–¼

Repairing a corrupted git repository with broken refs or bad objects involves running git fsck to diagnose internal damage, followed by targeted recovery operations to rebuild the broken index, HEAD, or detached references.

Can I safely rewrite git history without permanently damaging my repository?ā–¼

You can safely rewrite git history by using controlled destructive alternatives with backups, applying complex cherry-picking and history manipulation techniques while verifying changes via git status and targeted log inspection to avoid permanent damage.

Why does my git repository show a detached HEAD state and how do I fix it?ā–¼

A detached HEAD state in git occurs when you check out a specific commit instead of a branch, and you fix it by using git reflog to locate your previous position and creating a new branch from that entry to preserve your work.

How do I apply specific commits across branches using complex cherry-picking?ā–¼

Complex cherry-picking in git applies specific commits or ranges across branches by using controlled staging and selection during the workflow repair process, ensuring only the desired changes are integrated while managing conflicts safely.