Git reflog

From NovaOrdis Knowledge Base
Revision as of 06:36, 24 July 2020 by Ovidiu (talk | contribs) (→‎Internal)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

Recovering a Deleted Commit

This procedure applies even if the commit was deleted as part of a rebase. Anecdotal evidence seems to suggest that it applies to commits newer than 30 days.

git reflog

Look for the deleted commit.

git checkout <commit-id>

Will checkout the commit in "detached HEAD" state.