Hosting Operations
Changes system stateRevert the Suspect Release Commit
The suspect release has already been shared, and you need a rollback commit that preserves branch history.
Command
cd /lab/git-recovery-rollback && git restore -- app/config.yml && git revert --no-edit release-2026-06-25-1030
Before you run this
System impact: Changes system or application state. Needs inspection, scoping, and rollback notes before production use.
When not to use it: Do not use revert blindly when the bad release included database migrations or external side effects that need a separate rollback plan.
Expected output
Git restores the dirty file, creates a revert commit, and the recent log shows the new Revert commit above the suspect release.
System impact
Changes system state. The dirty config line is discarded, then a new local revert commit is created inside the disposable demo repository.
When to use it
Use when a bad commit is already published or shared and rollback should be represented as a forward-moving commit.
When not to use it
Do not use revert blindly when the bad release included database migrations or external side effects that need a separate rollback plan.
Recovery / rollback
Reset the disposable fixture branch back one commit or recreate the fixture.
Watch this command run
Command transcript
This sanitized transcript shows the commands and output shape without exposing host details.
$ cd /work/git-recovery-rollback && git status --short && git log --oneline --decorate -3
M app/config.yml
?? releases/current
de583c6 (HEAD -> main, tag: release-2026-06-25-1030) Release 2026-06-25 10:30
c15c7c6 (tag: release-2026-06-25-1000) Release 2026-06-25 10:00
ddb9d51 (tag: release-2026-06-24-1700) Release 2026-06-24 17:00
$ cd /work/git-recovery-rollback && git restore -- app/config.yml && git revert --no-edit release-2026-06-25-1030
[main 13b32e2] Revert "Release 2026-06-25 10:30"
Date: Fri Jun 26 00:27:39 2026 +0000
4 files changed, 3 insertions(+), 6 deletions(-)
delete mode 100644 db/migrate.sql
delete mode 100644 releases/2026-06-25-1030/VERSION
$ cd /work/git-recovery-rollback && git log --oneline --decorate -4
13b32e2 (HEAD -> main) Revert "Release 2026-06-25 10:30"
de583c6 (tag: release-2026-06-25-1030) Release 2026-06-25 10:30
c15c7c6 (tag: release-2026-06-25-1000) Release 2026-06-25 10:00
ddb9d51 (tag: release-2026-06-24-1700) Release 2026-06-24 17:00
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
cd /lab/git-recovery-rollback && git status --short && git log --oneline --decorate -3cd /lab/git-recovery-rollback && git restore -- app/config.yml && git revert --no-edit release-2026-06-25-1030cd /lab/git-recovery-rollback && git log --oneline --decorate -4
next steps
Related commands
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
Snapshot Git Status Before Recovery
Before rollback commands, capture the branch and dirty files.
cd /lab/git-recovery-rollback && git status --short --branch
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
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
Preview the Patch a Rollback Would Apply
Show the exact file changes before moving the branch back.
cd /lab/git-recovery-rollback && git diff --stat HEAD..release-2026-06-25-1000
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.
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.