Hosting Operations
Read-onlyBranch 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
Snapshot Git Status Before Recovery
Before rollback commands, capture the branch and dirty files.
git status --short --branch
Find a Discarded Commit in Reflog
A reset does not mean the commit vanished.
git reflog --date=iso --format='%h %gd %gs' -6
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
Show Files Changed Since Last Good Release
Compare the suspect release against the last known-good tag.
git diff --name-status release-2026-06-25-1000..HEAD
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.