git reflog --date=isoGit Recovery and Reflog
Git recovery patterns using reflog, ORIG_HEAD, fsck, dangling objects, and targeted reset or cherry-pick flows.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
Common Recovery Scenarios
Recover from reset, deleted branch, bad merge, and lost stash mistakes.
Recover after hard reset
Restore previous HEAD after disruptive operation when ORIG_HEAD is available.
bashANYrecoveryorig-head
bash
git reset --hard ORIG_HEADbashANYrecoverybranch
bash
git checkout -b recovered <dangling_or_reflog_commit>bashANYrecoverymerge
bash
git reset --merge ORIG_HEADbashANYrecoverystashfsck
bash
git fsck --no-reflog | grep danglingbashANYrecoverycherry-pick
bash
git cherry-pick <recovered_commit_sha>Dangling Objects and Inspection
Find unreferenced commits, blobs, and trees.
bashANYfsckintegrity
bash
git fsck --fullbashANYfsckdangling
bash
git fsck --full --danglingbashANYfsckshow
bash
git show <dangling_commit_sha>bashANYfsckblob
bash
git cat-file -p <blob_sha>More in Git
Git Patch and Email Workflows
Patch-oriented Git workflows using format-patch, apply, am, and range-diff for mailing-list and review-based collaboration.
Git Internals and Plumbing
Low-level Git objects, refs, trees, index, commit creation, and packfile plumbing for advanced users and debugging.
Git Hooks
Git hook locations, setup patterns, and reusable client-side hook snippets for linting, testing, policy, and automation.
Git Config Cookbook
Ready-to-use Git configuration recipes for identity, pull/push policy, aliases, tools, safety, and performance.
Git Revision Syntax
Git revision selectors, ranges, parents, symbolic refs, and object/path addressing.
Git Cheat Sheet
Comprehensive Git commands for day-to-day work, collaboration, history, releases, recovery, and advanced repository workflows.
Recommended next
Docker Swarm Cheat Sheet
DOCKER
Swarm cluster, node, service, and stack commands for container orchestration on Docker Engine.
Docker Buildx Cheat Sheet
DOCKER
Modern BuildKit and Buildx reference for multi-platform builds, cache, secrets, and remote outputs.
Dockerfile Cheat Sheet
DOCKER
High-value Dockerfile instructions, patterns, and build flags for reproducible and efficient image builds.
Docker Cheat Sheet
DOCKER
Comprehensive Docker Engine CLI reference for images, containers, networks, volumes, registries, contexts, and cleanup.