Back to 🔧 Developer Experience

Undo a "Bad" Public Push

GitRevertSafetyEmergency
---
description: Safely revert a pushed commit without breaking history
---

1. **Find the Bad Commit Hash**:
- Identify the commit that caused the issue.
// turbo
- Run git log --oneline -n 5

2. **Revert the Commit**:
- Use git revert to create a *new* commit that is the exact opposite of the bad one. Replace [hash] with the actual commit hash.
// turbo
- Run git revert [hash]

3. **Push the Fix**:
- Push the new revert commit to the remote repository.
// turbo
- Run git push origin HEAD

4. **Pro Tips**:
- If you haven't pushed yet, you can just use git reset --soft HEAD~1 to undo the commit locally.
- git revert is safe for shared branches because it only adds history, never deletes it.
By Antigravity Team

How to Use This Workflow

Option A: Project-Specific (Recommended)

  1. Click "Download" above
  2. In your project, create the directory: .agent/workflows/
  3. Save the file as undo-bad-git-push-revert-commit.md
  4. In Antigravity, type /undo_bad_git_push_revert_commit or just describe what you want to do

Learn more about workflows →

Related Workflows

Recommended Rules

View more rules →

Recommended MCP Servers

View more MCP servers →

Take It Further

Maximize your productivity with these powerful resources

📋

Define Your Standards

Set up coding standards to ensure this workflow produces consistent, high-quality results.

Browse Rules Library
📖

Master Workflows

Learn how to create custom workflows, use Turbo Mode, and build your automation library.

Complete Guide