git-reflog
Record and recover reference movements
TLDR
Show reflog
SYNOPSIS
git reflog [command] [options]
DESCRIPTION
git reflog records when refs (like HEAD and branch tips) are updated, providing a safety net for recovering lost commits. After accidental resets, rebases, or branch deletions, the reflog shows where refs previously pointed, allowing recovery of otherwise unreachable commits.
Entries in the reflog expire after a configurable period (default 90 days). The reflog is local only and is not shared between repositories.
PARAMETERS
show REF
Show reflog for ref (default).expire
Prune old reflog entries.delete
Delete specific entries.--all
Process all refs.--expire TIME
Expire older than time.--date FORMAT
Date format.-n NUM
Limit entries shown.--help
Display help information.
CAVEATS
Local only, not pushed. Entries expire (default 90 days). Won't help after gc removes objects.
HISTORY
git reflog is a core Git safety feature, providing local history of ref movements to enable recovery from destructive operations.
