Back to commands

Hosting Operations

Read-only

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

Before you run this

System impact: Read-only. Low when scoped to the shown target.

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

Expected output

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

System impact

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

Recovery / rollback: no state is changed.

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.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ cd /work/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

$ cd /work/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(-)
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  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

next steps

Related commands

Hosting Operations Read-only

Show Files Changed Since Last Good Release

Compare the suspect release against the last known-good tag.

cd /lab/git-recovery-rollback && git diff --name-status release-2026-06-25-1000..HEAD
Hosting Operations State change

Restore One File From Last Good Release

Recover a config file without rolling back the whole branch.

cd /lab/git-recovery-rollback && git restore --source=release-2026-06-25-1000 -- app/config.yml
Hosting Operations State change

Revert the Suspect Release Commit

Undo a bad release with a new commit instead of rewriting history.

cd /lab/git-recovery-rollback && git restore -- app/config.yml && git revert --no-edit release-2026-06-25-1030
Hosting Operations Read-only

Map Recent Release Commits

A rollback is easier when the last few release tags are visible.

cd /lab/git-recovery-rollback && git log --oneline --decorate --graph --all -8
Hosting Operations Read-only

Snapshot Git Status Before Recovery

Before rollback commands, capture the branch and dirty files.

cd /lab/git-recovery-rollback && git status --short --branch
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.