Back to commands

Hosting Operations

Read-only

Branch a Recovered Commit

You found a useful discarded commit in reflog and need to preserve it with a branch name.

Command

git branch recovered-incident-note HEAD@{1}

Before you run this

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

When not to use it: Do not create branches from reflog entries you have not inspected if the repository contains sensitive or unrelated work.

Expected output

The new branch points at the recovered incident note commit.

System impact

Read-only. A local branch named recovered-incident-note is created inside the local repositorysitory.

When to use it

Use when a reflog entry contains work you may need to inspect, cherry-pick, or restore later.

When not to use it

Do not create branches from reflog entries you have not inspected if the repository contains sensitive or unrelated work.

Recovery / rollback

Delete the local branch with git branch -D recovered-incident-note inside the demo repo.

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 Read-only

Map Recent Release Commits

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

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 style performance-task practice
  • Linux+ style troubleshooting review

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