Practical Git via GitExtensions
  • Git - a Distributed System
  • Bare Minimal Configurations
  • Creating a New Branch
  • Making a Commit
    • Adding only a portion of a file
    • Commit Message
    • Cherry-pick
    • Revert
  • Rewriting History
    • Rewording the Last Commit
    • Rewording Commit Message in Middle
    • Editing the Last Commit
    • Squashing Last Few Commits
    • Squashing Commits in Middle
    • Spliting Commit into Multiple
    • Removing a Commit
    • Pushing after Rewriting History
  • Lost and Found
  • Comparing Commits or Branches
  • Checking out a Branch into Another Folder
  • Blaming History
    • Blame
    • Bisect
  • Disabling Auto Tracking Branch
  • Line Ending
  • Ignore Unwanted Files
Powered by GitBook
On this page
  • reflog
  • Reflog in Grid View
  • Reflog List in GitExtensions
  • Recover via Git Maintenance

Was this helpful?

Lost and Found

PreviousPushing after Rewriting HistoryNextComparing Commits or Branches

Last updated 4 years ago

Was this helpful?

reflog

Whenever the HEAD (the current commit) changes, git will create a reflog. We can get it as long as the changes were commited.

Reflog in Grid View

You can right click any where in the commit grid view and in the context menu select View -> Show Ref log References

Reflog List in GitExtensions

To access the reflog, we go to the Commands menu and select the Show reflog menu item.

In the form we can see where the HEAD used to point to. Sometimes it's hard to tell which is the one we want, unfortunately there is not preview of the commit but we can create branches for couple of the HEADs and then go back to the main revision grid. We can do a Hard to the commit once we find it.

Command line:

git reflog -n # where n is the number of log items to show
git reset --hard <TheCommitSHA>

Recover via Git Maintenance

Repository Menu -> Git Maintenance -> Recover Lost Objects...