September 2009
Beginner
942 pages
85h 34m
English
reflog
git reflog show [branch]Show entries from the reflog, which tracks changes to local refs (branches). If branch is omitted, shows the reflog for HEAD.
The reflog tracks the “history of history.” Although commands like git reset can be used to undo a commit, the old commit still stays around in the reflog until it eventually expires. This allows you to undo many Git operations you might have performed by accident.
You can refer to entries in the reflog using branch@{n} notation. For example, HEAD@{5} means to use HEAD as it existed five changes ago.
To list all the recent changes to HEAD:
$ git reflogTo undo the most recent merge operation:
$ git reset HEAD@{1}