← Useful Tips
GitGit

git reflog: Recover commits and branch positions with Git reflog

Use git reflog to find recent HEAD and branch positions after a mistaken reset, rebase or branch move; it often makes seemingly lost commits recoverable.

git reflog
CautionThis action can change data or working state. Check what it will do before you run it.

Why it helps

Use git reflog to find recent HEAD and branch positions after a mistaken reset, rebase or branch move; it often makes seemingly lost commits recoverable.

How to use it

  1. Open the relevant app or terminal.
  2. Use the shortcut or command above in the relevant context.
  3. Check the result; for commands that change data, test on a small example first.
People also search for
git reflog: Recover commits and branch positions with Git refloggit reflogrecover commits and branch positions with git refloghow to recover commits and branch positions with git reflogGit recover commits and branch positions with git reflog

Related tips