Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log entries are missing after checking out a previous commit

Tags:

git

After rolling back to a previous commit in git using:

git checkout <commit hash>

and then perform a git log, all my log entries after the commit I just checked out are missing.

How do I get a listing of all commits once I've checked out a previous commit? I need to checkout the latest and go forward in time.

like image 417
Razor Avatar asked Feb 23 '23 03:02

Razor


1 Answers

git log shows the log from the current HEAD. Assuming the branch you want to see the log of is "master", to see the "full" log again you can do either of the following:

Checkout the branch and then run git log:

git checkout master
git log

Pass a reference to git log to use as the HEAD:

git log master

and then have a reference of "future" commits to checkout instead.

like image 132
Andrew Marshall Avatar answered Feb 26 '23 07:02

Andrew Marshall