- Home
- Skills
- DevOps & Cloud
- git advanced workflows
Works with the AI tools you already use
git advanced workflows
Navigate complex Git operations like rebase, bisect, and reflog recovery with safety-first command sequences.
$8
git advanced workflows
Example session with this skill installed
I accidentally did a hard reset on my feature branch 'api-fix' and lost three commits. I haven't pushed yet. How do I get them back safely?
- Read your context and instructions
- Compiled the git advanced workflows
I will help you recover your lost commits using the Git reflog. Since these changes were not pushed, they exist only in your local reflog history.
Git Recovery Plan: Lost Commits on 'api-fix'
| Phase | Action | Command | Purpose |
|---|---|---|---|
| 1. Backup | Create emergency tag | git tag recovery-backup | Ensure current state is marked before moving HEAD. |
| 2. Locate | Inspect reflog | git reflog show api-fix | Identify the SHA-1 hashes prior to the reset operation. |
| 3. Verify | Preview commit | git show <commit-sha> | Confirm the content of the lost work. |
| 4. Restore | Reset to SHA | git reset --hard <commit-sha> | Point the branch back to the desired state. |
| 5. Validate | Check log | git log --oneline -n 5 | Confirm the three lost commits are back in history. |
Command Sequence
# 1. Create a safety marker
git tag recovery-point-$(date +%s)
# 2. View the history of HEAD movements
git reflog
# 3. Look for the entry just before 'reset: moving to...'
# It will look like: HEAD@{1}: commit: Added auth middleware
# Replace HEAD@{1} with the specific index found
git reset --hard HEAD@{1}
Safety Controls
Abort Path: if the reset goes to the wrong point, use git reset --hard recovery-backup to return to where you started this recovery.
*
Risk: High. A --hard reset overwrites the working directory. Ensure you have no uncommitted changes before running.
Next steps
- Run
git reflogand identify the hash from just before the accidental reset. - Verify the commit content with
git show <hash>. - Execute the reset command to restore your work.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
The problem
Standard Git commands often fall short when history gets messy or regressions hide deep in the commit logs. Developers risk losing work or breaking shared branches when attempting complex rebases, reflog recoveries, or bisects without a clear safety net.
What it does
- Generates step-by-step plans for interactive rebases and history cleaning.
- Provides guarded workflows for recovering lost commits via the reflog.
- Automates the setup for
git bisectto isolate regressions efficiently. - Orchestrates multi-tasking environments using Git worktrees.
- Calculates safe cherry-pick sequences with pre-flight validation checks.
Why this beats prompting it yourself
Generic LLMs often suggest dangerous commands like --force or omit critical backup steps. This skill enforces a "safety-first" protocol, requiring --force-with-lease, mandatory backup branches, and explicit abort paths for every destructive operation.
Use cases
- Cleaning up a messy local feature branch before a Pull Request.
- Finding the exact commit that introduced a bug using automated bisect.
- Recovering a branch that was accidentally deleted or reset.
- Managing multiple active tasks simultaneously using worktrees instead of stashing.
Known limitations
Requires manual confirmation of repository state and branch sharing status. Does not execute commands directly in your shell.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 1 month ago
- Passed all security checks, Safe to install