Find previous branch tips
The reflog records where a branch or HEAD pointed, every time it moved: commits, checkouts, resets, rebases. View Reflog… lists those entries; choose one to show its commit in the graph or Restore as Branch.
Works in GitTree Free: every local Git feature, once you are signed in.
On this page
Before you start
- The commits you are looking for were on your computer: the reflog is local and is not pushed or fetched.
Where to find it
- The command palette: View Reflog….
| Action | macOS | Windows and Linux |
|---|---|---|
| The command palette, then View Reflog… | ⌘⇧P | Ctrl+Shift+P |
Steps
Open the reflog
Run View Reflog… and choose the reference under Reflog of, such as HEAD or a branch. Show Older Entries loads more.
Find the entry
Each entry says what moved the reference and when. Choose the one from before the change you want to undo.
Look or restore
Show in Graph selects that commit. Restore as Branch creates a branch there: type a New branch name and confirm.
Expected result
GitTree says Created branch …. Undo removes it again. The lost commits are reachable from that branch.
Try Undo first
For a step you took in GitTree, Undo is quicker: it reverses the last operation exactly (undo and redo). The reflog helps with older steps and with ones taken in a terminal.
If something goes wrong
“This reference has no reflog.”
Git keeps reflogs only for references that moved in this repository; a branch fetched but never checked out may have none. Try HEAD’s reflog.
Questions
How long does the reflog keep entries?
Git’s default keeps them for about 90 days, until garbage collection expires them.