Hosting Operations
Changes system stateRestore One File From Last Good Release
One file is dirty or suspect, and you want to restore just that path from a known-good release tag.
Command
cd /lab/git-recovery-rollback && git restore --source=release-2026-06-25-1000 -- app/config.yml
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 run this on a path with uncommitted work you still need unless you have saved or reviewed the diff.
Expected output
The diff for app/config.yml changes after the targeted restore.
System impact
Changes system state. app/config.yml in the disposable repo is replaced with the version from release-2026-06-25-1000.
When to use it
Use when you need a targeted file recovery from a tag, commit, or branch.
When not to use it
Do not run this on a path with uncommitted work you still need unless you have saved or reviewed the diff.
Recovery / rollback
Restore the file again from HEAD or discard the disposable fixture copy.
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 diff -- app/config.yml
diff --git a/app/config.yml b/app/config.yml
index 587c07b..eb4e72d 100644
--- a/app/config.yml
+++ b/app/config.yml
@@ -1,2 +1,3 @@
version=1.2
feature_flag=checkout-redesign
+debug_logging=true
$ cd /work/git-recovery-rollback && git restore --source=release-2026-06-25-1000 -- app/config.yml
$ cd /work/git-recovery-rollback && git diff -- app/config.yml
diff --git a/app/config.yml b/app/config.yml
index 587c07b..8be1a2f 100644
--- a/app/config.yml
+++ b/app/config.yml
@@ -1,2 +1,2 @@
-version=1.2
-feature_flag=checkout-redesign
+version=1.1
+feature_flag=off
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
cd /lab/git-recovery-rollback && git diff -- app/config.ymlcd /lab/git-recovery-rollback && git restore --source=release-2026-06-25-1000 -- app/config.ymlcd /lab/git-recovery-rollback && git diff -- app/config.yml
next steps
Related commands
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
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
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
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
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.