Back to commands

Hosting Operations

Changes system state

Restore 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.

demo@lab:~$

$ 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

  1. cd /lab/git-recovery-rollback && git diff -- app/config.yml
  2. cd /lab/git-recovery-rollback && git restore --source=release-2026-06-25-1000 -- app/config.yml
  3. cd /lab/git-recovery-rollback && git diff -- app/config.yml

next steps

Related commands

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

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
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 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
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
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.

  • lfcs:operations-deployment
  • lfcs:services-logs
  • linuxplus:provisional
  • linuxplus:troubleshooting
  • risk:production-state-change

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.