I sometimes check out some previous version of the code to examine or test. I have seen instructions on what to do if I wish to modify previous commits -- but suppose I make no changes. After I've done e.g. git checkout HEAD^
, how do I get back to the tip of the branch?.. git log
no longer shows me the SHA of the latest commit.
views:
42answers:
2
+1
A:
Have a look at the graphical gui ... gitk
it shows all commits. Sometimes it is easier to work graphcal ... ^^
tanascius
2010-03-11 17:47:58
yes, this is actually how I've done it in the past -- but I don't have the GUI available at the moment
Leo Alekseyev
2010-03-11 17:56:41
+6
A:
If you know the commit you want to return to is the head of some branch, or is tagged, then you can just
git checkout branchname
You can also use git reflog
to see what other commits your HEAD (or any other ref) has pointed to in the past.
Novelocrat
2010-03-11 17:56:26
wow, I was going to post the exact same answer! just when I was about to post it, the orange bar popped up telling me you beat me to it :P
hasen j
2010-03-11 17:57:32