Skip to main content

Reflog

The reflog is Git’s local safety log: every time HEAD, a branch, or the stash moves, Gitember records that line. You can use it to recover work after a deleted branch, a hard reset, a rewritten commit, or a dropped stash.

See also Git reflog in the Git documentation.

Opening the Reflog view​

In the repository tree, Reflog sits directly under Stashes. Click it to load every entry from HEAD, local branches, and refs/stash. reflog-tree..png

ColumnDescription
SelectorHEAD@{n}, branch@{n}, or stash@{n}
ActionClassified kind: commit, checkout, reset, stash, …
CommitShort SHA after the movement
WhenTime of the reflog line
MessageGit’s reflog comment (reset: moving to …, checkout: moving from …)

Use the filter box to search by selector, SHA, kind, or message.

Recover deleted branch​

After git branch -D (or Gitember’s delete), the last tip is still in the reflog.

  1. Select the checkout or commit line that still names the branch (often checkout: moving from my-branch to …).
  2. Right-click Recover deleted branch…
  3. Confirm or edit the branch name. Gitember creates that local branch at the recovered SHA.

Recover hard reset​

A hard reset moves HEAD and the working tree. The previous tip is the old SHA on the reset: line.

  1. Select the reset: entry.
  2. Right-click Recover hard reset…
  3. Confirm. Gitember hard-resets back to the SHA from before that reset.

Uncommitted work in the working tree is discarded.

Recover deleted commit​

Amend, rebase, or reset can leave a commit without a branch. The commit object is still in the reflog.

  1. Select the line whose Commit SHA you want back.
  2. Right-click Recover deleted commit…
  3. Enter a new branch name. Gitember points that branch at the commit.

Recover stash​

A dropped stash commit can be put back on the stash stack (git stash store).

  1. Select a stash@{n} line, or any line whose commit is the stash object.
  2. Right-click Recover stash…
  3. The stash list in the tree updates; apply it from Stashes as usual.

Summary​

ActionHow to trigger
Open reflogTree → Reflog (below Stashes)
Recover deleted branchRight-click → Recover deleted branch…
Recover hard resetRight-click → Recover hard reset…
Recover deleted commitRight-click → Recover deleted commit…
Recover stashRight-click → Recover stash…