No journal entries after checking the previous commit

After returning to the previous commit in git with:

git checkout <commit hash> 

and then do git log , all my log entries after the check I just checked completed.

How do I get a list of all commits after I checked the previous commit? I need to check the latter and go ahead on time.

+4
source share
2 answers

git log shows the log from the current HEAD. Assuming that the branch you want to see in the log is a β€œwizard”, to view the β€œfull” log again, you can do one of the following:

Reserve the branch and then run the git log:

 git checkout master git log 

Pass a link to git log for use as HEAD:

 git log master 

and then the link to the "future" is taken for verification.

+6
source

git checkout <commit hash> not rollback.

You might want to try git reset --hard <commit hash> if you want to roll back.

If you need a leading branch log (if the master is the branch you were in), you need to do:

 git log master 

You have currently checked for a specific commit, and the log will show commits until it is committed and committed after that.

Also, if you did this check to commit this commit, stop! You are in a separate HEAD state, and this is not just for checking commit. You can return to the master using git checkout master or you can even do git checkout -

0
source

Source: https://habr.com/ru/post/1386224/


All Articles