Works with the AI Agents you already use
Git History Rewrite Safely: Remove Files and Secrets
by Saizul Amin
This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice.
$6
Git History Rewrite Safely: Remove Files and Secrets
Example session with this skill installed
Run the Git History Rewrite Safely skill on my project and give me a prioritised list of what to fix, with exact changes.
- Read your context and instructions
- Compiled the git history rewrite
Here is what the Git History Rewrite Safely: Remove Files and Secrets skill produced.
Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.
Output
Reflog of HEAD (newest first):
HEAD@{2026-11-28 18:18:08 +0600} 6053d29f71b8 rebase (finish): returning to refs/heads/feature/r
HEAD@{2026-11-28 18:18:08 +0600} 6053d29f71b8 rebase (pick): Feature two
HEAD@{2026-11-28 18:18:08 +0600} 6ba35dbf3454 rebase (pick): Feature one
HEAD@{2026-11-28 18:18:08 +0600} 237a9913edbb rebase (start): checkout main <- rebase
Restore points (state just before each operation):
before amend at HEAD@{2026-11-28 18:18:08 +0600} (2026-11-28 18:18:08 +0600): 6ba35dbf3454 Feature one
git reset --hard 6ba35dbf3454 # = HEAD@{2026-11-28 18:18:08 +0600}
before reset at HEAD@{2026-11-28 18:18:08 +0600} (2026-11-28 18:18:08 +0600): 6053d29f71b8 Feature two
git reset --hard 6053d29f71b8 # = HEAD@{2026-11-28 18:18:08 +0600}
before rebase at HEAD@{2026-11-28 18:18:08 +0600} (2026-01-01 00:00:04 +0000): 76eb6d326164 Feature two
git reset --hard 76eb6d326164 # = HEAD@{2026-11-28 18:18:08 +0600}
Before resetting: commit or stash uncommitted work; reset --hard discards it.
What you do next
- Fix the highest-severity items first.
- Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
- Keep the skill installed and re-run it whenever the project changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Rewrite and repair local git history safely - amend, fixup commits with rebase --autosquash, squash, reword, reorder, split, drop, rebase onto main, undo a bad rebase/reset/amend/merge with the reflog, recover lost commits and deleted branches, and choose between reset, revert and restore. A pre-flight script checks the branch before any rewrite (pushed commits, protected branch, uncommitted changes, merge commits, rebase already in progress) and prints a backup command; a reflog script finds the exact restore point. Runs interactive rebases non-interactively (GIT_SEQUENCE_EDITOR) so an agent can do them.
Who it's for
Use when the user asks to squash, fixup, reword or clean up commits, rebase a branch, "undo my last commit", "I messed up a rebase", "get back a lost commit", force push, or asks reset vs revert.
What's inside
- Tested, offline Python script(s): reflog_report.py, rewrite_preflight.py (deterministic results, standard library only unless noted)
- Reference guides: recipes.md
- Step-by-step agent instructions in SKILL.md covering: When to use; When not to use; Workflow
Why it's worth it
Generic prompts guess. This skill gives your agent a proven procedure plus scripts that check the facts, so you get the same correct answer every time, with exact fixes instead of vague advice. See the real demo below.
Works with every major AI agent
Built on the open SKILL.md standard: Claude Code, Codex CLI, Cursor, VS Code Copilot, Gemini CLI, Windsurf and 20+ other agents.
Requirements
- Python 3.8+ for the bundled scripts
- No API keys, no account, runs locally
Open source: saizul/git-workflow-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.
How to use
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
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 2 days ago
- Software
Python 3.8+
Git