Git reflog: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Git Commands =Overview= =Recovering a Deleted Commit= This procedure applies even if the commit was deleted as p...")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:


* [[Git_Commands#Local_Repository_Information|Git Commands]]
* [[Git_Commands#Local_Repository_Information|Git Commands]]
* [[Git_Concepts#Commit_Operations|Commit Operations]]


=Overview=
=Overview=
Line 8: Line 9:


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.
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.

Latest revision as of 06:36, 24 July 2020

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.