06 / 1830 min read

Make Changes Safely

Use history, isolated changes, tests, environments, and rollback so speed does not turn into fear.

Git is recorded history

Git records snapshots of a project's files and the relationship between those snapshots. A repository is the project history Git tracks. A commit is one named snapshot with an author, time, and explanation. GitHub can store a shared copy of that repository, but Git and GitHub are not the same thing.

A good commit contains one coherent change and explains why it exists. It gives you a point to review, share, compare, or restore. Saving a file records it on your computer; committing records a meaningful checkpoint in the project history; pushing sends commits to a shared repository.

The goal is not to avoid mistakes. It is to make mistakes small, visible, and reversible.

Branches and worktrees

A branch is a movable label pointing to a line of project history. It lets you develop a change without immediately moving the main line. When the change is reviewed and ready, it can be merged. Branches isolate history, but they normally share the same project folder.

A worktree gives another branch its own folder on disk. This is useful when two agents or two pieces of work need to run at the same time without rewriting the same files in one folder. The important rule is simple: know which folder, branch, and base commit each worker owns before it starts editing.

More branches do not automatically create safety. Safety comes from clear ownership, small scope, current base history, reviewable diffs, and an intentional merge.

Read the diff

A diff shows what changed between two versions: added lines, removed lines, and modified files. It is the primary surface for reviewing an agent's work. Start with the list of changed files, then inspect configuration, data models, permissions, external actions, and deleted behavior before cosmetic details.

Ask the agent to explain surprising changes, but verify the explanation against the diff. Generated summaries can omit accidental edits. If the diff is too large to understand, the change is too large to accept as one unit.

Case file

speed requires a review surface

Replit made software creation dramatically faster, including for people whose first expertise was not writing code. That speed changes the bottleneck. Producing a change becomes easier; understanding its scope and proving its behavior become more important.

A coding agent can edit many files, install dependencies, change configuration, and report success in minutes. Without an isolated branch, a readable diff, tests, and environment-specific proof, the builder may not know which change created the result or how to recover when the next change breaks it.

The answer is not to slow back down to manual typing. It is to build a safer lane around the speed: bounded task, owned workspace, inspectable history, risk-matched verification, and reversible release.

Decisions made

  1. 01Give each change a narrow outcome and clear file ownership.
  2. 02Inspect the actual diff before trusting the agent summary.
  3. 03Match verification to the behavior and environment being claimed.
  4. 04Define the rollback path before deployment.

Agentic speed becomes durable engineering only when every change has history, isolation, review, proof, and recovery.

Tests are executable expectations

A test is a repeatable check of expected behavior. A unit test checks a small piece of logic. An integration test checks components working together. An end-to-end test follows a user path through the running system. A manual check is still useful, but it is harder to repeat consistently.

Tests reduce uncertainty; they do not prove the absence of every problem. Match each test to a risk. A formatting function needs deterministic examples. A database workflow needs integration coverage. A checkout or approval flow needs a complete user-path test. A visual page needs inspection at realistic screen sizes.

Environments and deployment

Development is where you make and debug changes. A preview or staging environment lets people inspect a candidate version away from production. Production is the environment real users depend on. Each can have different data, secrets, domains, permissions, and infrastructure.

Deployment is the controlled act of placing a specific version into an environment. A successful build says the code could be packaged. A successful deploy says a platform accepted a version. A live verification says the intended behavior is actually visible in that environment. Keep those claims separate.

Rollback and recovery

Rollback means returning to a previously known version or reversing a change. Code rollback may be simple; data rollback can be much harder because users may have created new records after deployment. Plan the recovery path before a consequential release.

Before approving an agent-made change, know the last good version, the signals that indicate failure, the person authorized to reverse it, and whether any data transformation is backward compatible. Reversibility is a design property, not an emergency command you improvise later.

  • Preserve a known-good version.
  • Define failure signals before release.
  • Back up or migrate durable data deliberately.
  • Keep secrets out of commits and diffs.
  • Record who deployed what and how it was verified.

Across the business

What this looks like in other departments

The engineering principle stays the same; the workflow, risk, and proof change with the domain.

Finance

Protect calculations

Version a reconciliation rule, compare its diff, run fixed examples, and preserve the prior calculation before using it in close.

People & HR

Review permission changes

Isolate an onboarding-role change and verify both the access granted and the access explicitly denied.

Marketing

Preview before publishing

Review campaign changes at a private URL, check mobile rendering and links, then promote the exact version that was approved.

Operations

Recover an automation

Keep the prior workflow version, test duplicate events, and define how queued work resumes if a release fails.

Technical deep dive

The safe-change pipeline

A minimal control path from an idea to a live, reversible change.

  1. 01AnchorStart from a known branch and commit; preserve unrelated work and record the intended outcome.
  2. 02IsolateUse a branch or worktree with one owner, one scope, and explicit boundaries.
  3. 03InspectReview the changed-file list and diff, especially configuration, data, permissions, and side effects.
  4. 04VerifyRun static checks, focused tests, a build, and realistic behavior checks matched to the risk.
  5. 05ReleaseDeploy one identifiable version to the intended environment with correct configuration.
  6. 06ObserveConfirm live behavior and logs, then retain the proof and the known rollback target.

Reference schema

anchor: repository + branch + base commit
scope: outcome + owner + allowed files + exclusions
review: diff + risky surfaces + unresolved questions
verification: command + environment + result
release: version + target + actor + time
recovery: last good version + rollback action + data caveat

Try it yourself

Supervise one safe change

Use an agent to make a small visible change while you own the history, review, tests, and proof.

  1. 1Record the current branch, commit, and working-tree status.
  2. 2Create or choose an isolated branch and define the allowed scope.
  3. 3Have the agent implement the change and explain the changed files.
  4. 4Inspect the diff and run the relevant checks yourself.
  5. 5Write the rollback step before merging or deploying.

Reusable artifact

Safe-change checklist

A review sheet for every agent-assisted change that matters.

Outcome: [one verifiable result]
Repository and folder: [canonical locations]
Base branch and commit: [starting point]
Change branch or worktree: [isolated owner]
Diff reviewed: [files and risky surfaces]
Checks: [lint, types, tests, build, behavior]
Target environment: [local, preview, production]
Live proof: [URL, version, screenshot, logs]
Rollback: [last good version and exact action]

Before you move on

Receipt checklist

  • The starting branch and commit are known.
  • The change is isolated and the actual diff is reviewed.
  • Tests and environment checks match the risk being claimed.
  • The release has a version, live proof, and rollback target.

Primary sources

Further reading

Home
Book
Blog
Calugaru Labs
GitHub
LinkedIn
Email
Theme