Create a new branch from a reflog entry without moving current branch yet.
Section: Recovering Commits
Recover work into a new branch
bash
bash
git branch recovered-work HEAD@{3}Explanation
Safer than immediately hard-resetting because it preserves your current branch while giving you a recovery pointer.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Recovering Commits
Restore branch to a reflog entry
Move the current branch back to a previous recorded state.
Check out a lost commit directly
Inspect a recovered commit before deciding what to do with it.
Restore a lost commit by cherry-picking it
Apply a recovered commit onto the current branch.
Find dangling commits and objects
List objects that are no longer reachable from refs.