Marcelle LabsMarcelle Labs
·Qwynn Marcelle

SnapBack vs git reset: Why Rollback Isn't Enough for AI-Assisted Development

Git reset handles commits. AI mistakes happen before commits — tangled with legitimate work, invisible in diffs. Here's why you need a different recovery model.

SnapBackGitAI SafetyDeveloper ToolsRollback

TL;DR

    • The Problem: git reset works for commits — but AI mistakes happen before commits, tangled with legitimate changes, often invisible in large diffs
    • Why It Matters: In the $12k incident, git reset wasn't enough — the AI changes were mixed with real work. Recovery took 6 hours instead of seconds
    • The Difference: git reset works at commit granularity; SnapBack snapshots at file-change granularity, before the AI change is applied
    • Key Takeaway: These tools solve different problems. Git is version control. SnapBack is AI change control. You need both.

When I talk about what happened the night a $12,000 production incident brought our checkout to zero, people often ask: "couldn't you just git reset?"

Yes and no. Let me explain exactly why rollback failed, what would have worked, and how to think about the difference between git and AI change control.


What git reset Actually Does

git reset operates at the commit level. It moves the HEAD pointer, optionally unstaging or discarding changes at the commit boundary:

git reset --soft HEAD~1    # Uncommit, keep staged changes
git reset --mixed HEAD~1   # Uncommit, unstage changes  
git reset --hard HEAD~1    # Uncommit, discard all changes

This is powerful for undoing committed work. But notice the fundamental assumption: changes are committed, and commits are atomic units of intent.

AI development breaks this assumption in two ways.


How AI Mistakes Escape git reset

Problem 1: The AI Tangles Its Changes With Your Work

Here's what happened on the night of the $12k incident:

  1. I asked Cursor to "clean up unused imports" across the codebase
  2. I reviewed the diff quickly — it showed 47 files changed
  3. I accepted all changes
  4. Some of those changes were legitimate cleanup. Some were destructive (removing @stripe/stripe-js, renaming env vars).
  5. I committed everything together: "Refactor: Optimize imports and dependencies"

When the production incident happened at 3:47 AM, git reset --hard HEAD~1 would have undone all of that commit — including the six legitimate files of cleanup that I had actually wanted.

So I couldn't just reset. I had to surgically extract my real changes from the AI's bad changes, in the middle of the night, under pressure.

That's the 6-hour recovery. Not because git reset is broken. Because the AI mistake was baked into the commit with legitimate work.

Problem 2: AI Mistakes Often Happen Before You Commit

A more common scenario: you're working on a feature, you ask the AI for help mid-session, it makes a subtle mistake, and then you continue building on top of that mistake without realizing it.

By the time you notice — maybe when the tests fail, maybe when a colleague reviews — you've made 20 more changes on top of the AI's bad foundation. git reset to the pre-AI state would undo those 20 changes too.

Problem 3: Not All AI Mistakes Are Visible in Diffs

Some of the most dangerous AI changes look correct in isolation. A renamed variable. A "simplified" expression. A refactored utility that removes a specific edge case handling your business logic relied on.

These changes pass the diff review. They pass TypeScript. They might even pass tests. The mistake only becomes visible in production, under real load, with real data.

By that point, the change is buried in a week of commits.


What SnapBack Does Differently

SnapBack operates at a different granularity: file-change granularity, before the change is applied.

When you're working in VS Code and an AI tool (Cursor, Copilot, Claude, Windsurf) is about to apply changes to a file, SnapBack detects the high-risk activity and snapshots the current workspace state — not the last commit, but the actual current state of your files on disk, including any uncommitted work.

AI suggests change to package.json
  → SnapBack detects high-entropy change to critical file
  → SnapBack snapshots current workspace state (3ms)
  → You review and accept the change
  → Change is applied to disk
  → Something breaks
  → Alt+Z
  → Workspace restored to exact state before AI touched it (3 seconds)

The key difference: SnapBack creates the restore point before the AI change, not at commit time.

This means the restore point contains:

  • Your legitimate uncommitted work
  • The pre-AI state of the files the AI touched
  • Not mixed with the AI's changes at all

Side-by-Side Comparison

Scenariogit resetSnapBack
Undo a committed mistake
Undo an uncommitted AI mistake⚠️ Loses uncommitted work✅ Targeted restoration
Undo AI mistake mixed with legitimate commits❌ Manual surgery required✅ Pre-AI snapshot point
Undo a mistake discovered 3 days later❌ Many commits to unwind⚠️ Depends on snapshot retention
Understand what the AI changed (intelligence)❌ No AI-specific context✅ Pattern memory + trust scores
Prevent future AI mistakes in the same file✅ Codebase learning layer

When to Use Each

Use git reset for:

  • Undoing your own committed work that you want to redo differently
  • Reverting a deployment that caused issues
  • Cleaning up a messy commit history before a PR
  • Reverting to a known-good state from a tagged release

Use SnapBack for:

  • Any situation where AI tools are actively modifying your files
  • When you're in an exploratory AI session and want to be able to "undo everything the AI did"
  • When you've accepted AI changes and something broke before you committed
  • When AI changes are tangled with legitimate work and you need surgical restoration

Use both — they're complementary, not competitive. Git is your long-term version control system. SnapBack is your AI session safety layer. The $12k incident needed SnapBack because it happened in a zone where git alone was insufficient.


The Deeper Issue: AI Changes Need a Different Mental Model

When you write code yourself, you understand the full intent of every line. You know why you deleted that function, why you renamed that variable, why you added that dependency. The commit message reflects your intent.

When AI writes code, the intent is the AI's pattern-matching result, not yours. You may approve the change, but you don't necessarily understand every implication.

This is why AI development needs a layer below git — a layer that captures workspace state at the granularity of individual AI interactions, not at the granularity of developer-curated commits.

SnapBack is that layer. Git is still essential. But for AI-assisted development specifically, you need both.


Frequently Asked Questions

Can I use git stash instead of SnapBack?

git stash is closer to SnapBack's purpose — it saves your working directory state before committing. But it requires you to remember to stash before every AI interaction, and it doesn't integrate with AI tools to detect when a high-risk change is about to happen. It's a manual approximation of what SnapBack does automatically.

Does SnapBack work with all AI coding tools?

Yes. SnapBack works at the VS Code file system level — it detects when files change, regardless of which tool caused the change. It works with Cursor, GitHub Copilot, Claude (via Cline/Aider), Windsurf, and any other VS Code-integrated AI tool.

What happens if I want to restore to a state from 3 days ago?

That's what git is for. SnapBack snapshots are designed for session-level recovery ("undo what the AI did in the last 30 minutes"), not long-term version control. The two tools have different retention scopes.

Is there a performance overhead to SnapBack snapshots?

Snapshots are incremental and typically take 3-15ms depending on the number of changed files. In practice, you won't notice them during normal development. The overhead is orders of magnitude smaller than the recovery time for a single AI-caused production incident.