Back to commands

Hosting Operations

Read-only

Find a Discarded Commit in Reflog

Someone ran reset during incident work and you need to locate the commit that disappeared from the branch tip.

Command

git reflog --date=iso --format='%h %gd %gs' -6

Before you run this

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

When not to use it: Do not wait weeks to inspect reflog; entries can expire or be pruned.

Expected output

Recent reflog entries showing a reset and the discarded incident-note commit.

System impact

Read-only. Nothing changes. Git prints recent HEAD movements from the reflog.

Recovery / rollback: no state is changed.

When to use it

Use after an accidental reset, checkout, commit amend, or branch movement.

When not to use it

Do not wait weeks to inspect reflog; entries can expire or be pruned.

next steps

Related commands

Hosting Operations Read-only

Branch a Recovered Commit

Put a name on the reflog commit before it slips away.

git branch recovered-incident-note HEAD@{1}
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
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

Snapshot Container CPU and Memory

Get Docker resource usage once, without leaving a live dashboard running.

docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.NetIO}}\t{{.BlockIO}}'
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

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