Back to lessons

Hosting Operations

Preview the Patch a Rollback Would Apply

You know the last good release tag, but you want to inspect what a rollback would remove before changing anything.

Command

cd /lab/git-recovery-rollback && git diff --stat HEAD..release-2026-06-25-1000

What changed

Nothing changes. Git prints the patch summary from the current commit back to the last good release.

Danger

safe

When to use it

Use before reset, revert, or deploy rollback when you need a quick preview of the files and line counts involved.

When not to use it

Do not treat a small diff as automatically safe; migrations, config, and external state still need review.

Undo or recovery

No undo needed because this command is read-only.

Expected output

A diffstat showing the config, migration, public page, and release metadata changes that rollback would remove.

demo script

Disposable terminal steps

  1. cd /lab/git-recovery-rollback && git diff --name-status HEAD..release-2026-06-25-1000
  2. cd /lab/git-recovery-rollback && git diff --stat HEAD..release-2026-06-25-1000

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ cd /lab/git-recovery-rollback && git diff --name-status HEAD..release-2026-06-25-1000
M	app/config.yml
D	db/migrate.sql
M	public/index.html
D	releases/2026-06-25-1030/VERSION
::exit-code::0
$ cd /lab/git-recovery-rollback && git diff --stat HEAD..release-2026-06-25-1000
 app/config.yml                   | 4 ++--
 db/migrate.sql                   | 1 -
 public/index.html                | 2 +-
 releases/2026-06-25-1030/VERSION | 2 --
 4 files changed, 3 insertions(+), 6 deletions(-)
::exit-code::0

YouTube Short

Preview rollback first.

Before moving a branch or release pointer, diff current against the last good tag. The rollback patch should be visible.

LinkedIn hook

Show the exact file changes before moving the branch back.

Question: Do you preview rollback patches before changing refs?

experiments

A/B tests to run

Metric: save_rate

A: Preview rollback before changing refs.

B: The rollback patch should be visible.