Git commits and rollbacks as a safety net for client edits
By Yash Garg · · 6 min read
Client edits are safe when every change is a Git commit, every commit gets a preview before it goes live, and you know the two ways back: roll back the deployment in your host to fix the live site, then revert the commit in Git so the mistake doesn't return on the next deploy. Commits tell you what changed, previews catch most problems early, and rollbacks cover the rest.
Below: each layer, how Vercel, Netlify and Cloudflare differ, and a runbook for the day a client publishes something broken.
The four layers of the safety net
| Layer | What it protects against | Where it lives |
|---|---|---|
| Commit history | Not knowing who changed what, or when | Your Git repository |
| Preview deployments | A broken change reaching the live site | Your host |
| Host rollback | A broken live site right now | Your host's dashboard or CLI |
| Git revert | The same mistake coming back on the next deploy | Your Git repository |
A rollback without a revert only fixes the site until the next push. A revert without a rollback leaves it broken while the new build runs.
Layer 1: commit history
When every client edit is its own commit, the repository answers the first question after any incident: what changed? The Pro Git book shows how to filter the log by author and search for a string with the --author and -S options, to find the commit that changed a price or deleted a sentence.
That only works if edits are small: one change per commit, or a tool that commits once per publish. TurnIntoCMS, for example, writes each publish as one commit whose message lists the changes and names the client who made them.
Commit message conventions for client edits
Git's documentation suggests starting a message with a single short line of no more than 50 characters, then a blank line and a longer description. For client work, add a prefix that separates content from code. The Conventional Commits specification uses a type, an optional scope and a description, and it allows types other than fix and feat.
An example convention:
| Change | Example message |
|---|---|
| Client copy edit | content(home): update hero headline |
| Client price change | content(pricing): change Pro plan price |
| Client image swap | content(team): replace photo for new hire |
| Your layout change | feat(pricing): add annual billing toggle |
| Your bug fix | fix(nav): stop menu overlapping logo |
The content prefix lets you list client edits with the --grep option, which searches commit messages, and it makes it obvious when a code change, not a copy change, caused a problem.
Layer 2: preview deployments
A preview is a full build of a change at its own URL, separate from production. Vercel creates a preview deployment by default when you push a commit to a branch that is not your production branch or open a pull request.
The practical setup: client edits go to a staging branch, the client checks the preview URL, and you merge once they confirm. Publish straight to production and rollback becomes your first line of defence instead of your last.
Layer 3: host rollbacks
A rollback points your live domain back at an earlier build. It doesn't touch your Git history, which is why you still need a revert afterwards. Each host has its own catch.
| Host | How to roll back | The catch |
|---|---|---|
| Vercel | Instant Rollback from the production deployment tile | New pushes don't go live until you promote a deployment |
| Netlify | Publish Deploy on an earlier successful deploy | With auto publishing on, the next Git deploy overwrites the rollback |
| Cloudflare Workers | Rollback in the dashboard or with Wrangler | Connected resources such as KV and D1 are not changed by the rollback |
Vercel
Vercel says after a rollback it turns off auto-assignment of production domains, and Hobby users can only roll back to the immediately previous deployment. That protects you during an incident, but if nobody promotes a deployment afterwards, the client's next edits build and never appear.
Netlify
Netlify's rollback publishes a previous atomic deploy without triggering a new one, and its docs warn that with auto publishing on, any new Git-triggered production deploy overwrites the rolled-back version. Lock deploys (Netlify's way of stopping auto publishing) until the fix is in Git.
Cloudflare Workers
A Workers rollback creates a new deployment set to 100% of traffic for the version you pick, and you can only go back to the 100 most recently published versions. If your Worker reads from a database, old code against new data can fail.
Layer 4: git revert
The git revert docs describe it as a way to record new commits that reverse the effect of earlier ones. Both the bad edit and its undo stay in the log, which is what you want when a client asks what happened. The same page notes that git reset and git restore, the usual alternatives, can discard uncommitted changes in your working directory, so reach for revert first on a shared branch.
When to revert and when to roll back
| Situation | Do this |
|---|---|
| Live site is broken or shows wrong content now | Roll back in the host, then revert in Git |
| Wrong copy, but the site works | Revert only and let the next deploy fix it |
| Mistake found on a preview | Revert or fix on the branch; nothing to roll back |
| Several edits since the bad one, all wanted | Revert only the bad commit and keep the rest |
| Build fails after an edit | Revert, push and confirm the next build passes |
Runbook: something broke after a client edit
Copy this table into your project notes:
| Step | Action | Why |
|---|---|---|
| 1 | Confirm what is broken and on which URL | A preview problem needs no rollback |
| 2 | Roll back production in your host | Restores the live site without waiting for a build |
| 3 | Lock auto publishing if your host needs it | Stops the next push from undoing the rollback |
| 4 | Find the commit with git log | The content prefix and author narrow it down |
| 5 | Revert that commit on the production branch | Fixes the source so the next deploy is clean |
| 6 | Check the new preview or build | Confirms the revert didn't break anything else |
| 7 | Restore normal deploys | Promote a deployment on Vercel or resume auto publishing on Netlify |
| 8 | Tell the client what changed and why | They learn which field caused the problem |
Common mistakes
- Rolling back and never reverting. The bad commit returns with the next deploy. Fix: treat the revert as part of the rollback.
- Leaving a project rolled back. Client edits pile up unseen. Fix: make step 7 mandatory.
- Mixing client edits and code changes in one commit. Reverting the copy also reverts your feature. Fix: separate commits with a content prefix for client work.
- Rewriting history on a shared branch. A reset and force push can lose other people's commits. Fix: revert instead, and protect the production branch as described in our guide to letting clients edit Next.js without a CMS.
- Expecting a rollback to restore data. Code goes back, databases and storage don't. Fix: keep editable content in the repository, where a revert covers it.
For the client side of this setup, read about letting clients edit a Next.js site. If you are weighing a Git-based CMS instead, compare client editing tools or see how TinaCMS compares.
FAQ
Does a host rollback change my Git history?
No. A rollback points your domain at an earlier build and leaves the repository as it was, which is why you still revert the commit afterwards.
Should clients be able to roll back the site themselves?
Usually not. A rollback also hides every edit made after the target build, so keep it with the developer and give the client a clear way to report problems.
Is git revert safe on a shared branch?
Yes. It adds a new commit instead of rewriting existing ones, so other people's copies of the branch stay valid.
What should a client edit's commit message say?
A short first line with a content prefix, the page and the change, for example "content(pricing): change Pro plan price", with details in the body if needed.
Sources
- Viewing the Commit History (git-scm.com, checked November 18, 2026)
- git-commit Documentation (git-scm.com, checked November 18, 2026)
- Conventional Commits (conventionalcommits.org, checked November 18, 2026)
- Environments (vercel.com, checked November 18, 2026)
- Performing an Instant Rollback on a Deployment (vercel.com, checked November 18, 2026)
- Manage deploys (docs.netlify.com, checked November 18, 2026)
- Rollbacks (developers.cloudflare.com, checked November 18, 2026)
- git-revert Documentation (git-scm.com, checked November 18, 2026)