Back to commands

Hosting Operations

Read-only

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

git restore --source=release-2026-06-25-1000 -- app/config.yml

Before you run this

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

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

Read-only. app/config.yml in the local repository 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 example copy.

next steps

Related commands

Hosting Operations Read-only

Revert the Suspect Release Commit

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

git restore -- app/config.yml && git revert --no-edit release-2026-06-25-1030
Hosting Operations Can be slow

Create a SHA256 Checksum Manifest

A file list says what exists; checksums say whether bytes match.

sha256sum source/app/config.yml source/content/index.md source/content/about.md source/assets/logo.svg
Hosting Operations Deletes data

Diff Restored Config Against Expected

A restored config can exist and still be the wrong config.

BACKUP_ROOT=/srv/backups/site EXPECTED_CONFIG=/srv/backups/site/expected/app/config.yml RESTORE_SANDBOX=/tmp/linuxoneliners-restore/full && rm -rf "$RESTORE_SANDBOX" && mkdir -p "$RESTORE_SANDBOX" && tar -xf "$BACKUP_ROOT/2026-06-25/site.tar" -C "$RESTORE_SANDBOX" && diff -u "$EXPECTED_CONFIG" "$RESTORE_SANDBOX/app/config.yml"
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 style performance-task practice
  • Linux+ style troubleshooting review

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