Build with AI: From Zero to Your First App · Module 6: Working reliably with AI coding tools
Snapshot Before a Change, Roll Back Cleanly
Snapshots turn 'I wish I had not done that' into a one-step undo. This lesson replaces version-word file names with a snapshot habit that survives every experiment.
9 min reading
Objectives
- Snapshot a project before any AI-assisted change
- Describe what a snapshot holds: files plus the reason line
- Roll back cleanly when a change goes wrong
- Explain why file names must not version
Why this matters
AI edits are fast and sometimes wrong in ways visible only later (a form that broke during styling, found Thursday). Without a snapshot, Thursday means archaeology: which change broke it, which file holds the good version. With a snapshot, Thursday means one step back to Wednesday's known-good state, then a smaller retry. Experimentation without snapshots is gambling; with them it is engineering.
Concepts
What a snapshot is. A dated copy of the project files plus one reason line: "2026-10-05 before menu row restyle." Copy the folder, name it with the date and reason, keep working in the original. No tools required: file copies are the whole technology at course scale. Lesson M03L11's naming discipline stays clean because versions live in snapshots, never in file names.
When to snapshot. Before every AI-assisted change, before every multi-file edit, before trying something you do not fully understand. The cost is seconds; the payout is the freedom to attempt bold changes. Skipping ("this one is small") predicts exactly the change that breaks something.
Rolling back cleanly. Decide the change failed (criterion missed twice, new regressions appear). Close the attempt, restore the snapshot copy as the working project, note what was learned in one line, retry smaller. Rollback is not defeat; it is the mechanism that makes retries cheap, which makes learning fast.
Worked example
Wednesday snapshot: "before validation rewrite." Thursday's rewrite clears entered values (M05L18 regression). Diagnosis takes ten minutes; instead of surgery on the broken version, restore Wednesday's copy in one move, note "rewrite dropped value-keeping", retry as two single changes (messages first, keeping second). Total cost: one restore plus two small messages instead of an evening of archaeology.
Expected result: a snapshot taken before your next change with a reason line, plus one practiced restore.
The common wrong move
Snapshot sprawl: twenty undated copies named copy, copy2, final-backup. One naming shape (date plus reason), old snapshots deleted when their change is verified. Order, not accumulation.
Lab and next step
Lab A17 practices snapshot plus rollback on a deliberately risky edit. Next, lesson 23 turns handoffs into a reusable project summary for fresh chats.
Quick check
An optional 4-question self-check. Answers never leave your device, are not stored, and never count toward any assessment.
Lesson feedback
No published feedback yet.
Log in and complete the lesson to leave feedback.
Exercise
Snapshot your project with a dated reason line before your next AI-assisted change. Then practice one restore to a scratch copy and note the time it took.
Pass criteria
Snapshot present with date plus reason before the change; restore practiced with elapsed time under five minutes; one-line lesson noted.