{"thread":{"id":"28816","subject":"checking out later commits from rolled back state","startedAt":"2011-11-01T14:36:47Z","lastAt":"2011-11-01T14:58:58Z","messageCount":3,"participants":["photoshop_nerd","Alexey Shumkin","Vincent van Ravesteijn"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178623","messageId":"1320158207959-6951892.post@n2.nabble.com","threadId":"28816","inReplyTo":null,"subject":"checking out later commits from rolled back state","fromName":"photoshop_nerd","fromEmail":"jbreuer@consumercredit.com","sentAt":"2011-11-01T14:36:47Z","receivedAt":"2011-11-01T14:36:47Z","isPatch":false,"sender":{"key":"jbreuer@consumercredit.com","avatar":null},"body":"Hello, I a m relatively new to git, and my question pertains to moving back\nand forth through the history of my commits.\n\nHere is how I open a previous commit:\n\n1)$ git log\n\n2) (get sha1 hash of previous commit)\n\n3)$ git checkout <hash of my previous commit>\n\nthe problem is that once I am working with that commit, git log only shows\nthe hash tags up to the time that the commit was made, but not any of the\nlater commits. Is there a way to get the hash tags of my later commits when\nI am in that rolled back state?\n\n--\nView this message in context: http://git.661346.n2.nabble.com/checking-out-later-commits-from-rolled-back-state-tp6951892p6951892.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"178625","messageId":"20111101185626.6e16326c@zappedws","threadId":"28816","inReplyTo":"1320158207959-6951892.post@n2.nabble.com","subject":"Re: checking out later commits from rolled back state","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-11-01T14:56:26Z","receivedAt":"2011-11-01T14:56:26Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"usually, before you checkout a \"past\" commit you are on a \"current\"\nnamed branch\nso, do\n$ git log <branch_you_were_on_before>\n\nIn general, most \"history\" git commands take a commit hash as an\nargument and HEAD as a default one if none was specified\n(HEAD is always CURRENT commit (you are on), it is a difference of SVN)\n\nwhen you ran\n$ git log\nit was, actually, \n$ git log HEAD\n\nAlso, you may specify several commits as arguments of git log\nIt it very usefull to use (in terminal) to see how branches are diverged\n(on X/Windows gitk is more pretty)\n$ git log --oneline --graph --decorate <branch1> <branch2> <branchN>\n\n\nThere is also  \"git reflog\" command\nRTM git-reflog\n\n> Hello, I a m relatively new to git, and my question pertains to\n> moving back and forth through the history of my commits.\n> \n> Here is how I open a previous commit:\n> \n> 1)$ git log\n> \n> 2) (get sha1 hash of previous commit)\n> \n> 3)$ git checkout <hash of my previous commit>\n> \n> the problem is that once I am working with that commit, git log only\n> shows the hash tags up to the time that the commit was made, but not\n> any of the later commits. Is there a way to get the hash tags of my\n> later commits when I am in that rolled back state?\n> \n> --\n> View this message in context:\n> http://git.661346.n2.nabble.com/checking-out-later-commits-from-rolled-back-state-tp6951892p6951892.html\n> Sent from the git mailing list archive at Nabble.com.\n"},{"id":"178626","messageId":"4EB00932.1090604@lyx.org","threadId":"28816","inReplyTo":"1320158207959-6951892.post@n2.nabble.com","subject":"Re: checking out later commits from rolled back state","fromName":"Vincent van Ravesteijn","fromEmail":"vfr@lyx.org","sentAt":"2011-11-01T14:58:58Z","receivedAt":"2011-11-01T14:58:58Z","isPatch":false,"sender":{"key":"vfr@lyx.org","avatar":"https://avatars.githubusercontent.com/u/687868?v=4"},"body":"Op 1-11-2011 15:36, photoshop_nerd schreef:\n> Hello, I a m relatively new to git, and my question pertains to moving back\n> and forth through the history of my commits.\n>\n> Here is how I open a previous commit:\n>\n> 1)$ git log\n>\n> 2) (get sha1 hash of previous commit)\n>\n> 3)$ git checkout<hash of my previous commit>\n>\n> the problem is that once I am working with that commit, git log only shows\n> the hash tags up to the time that the commit was made, but not any of the\n> later commits. Is there a way to get the hash tags of my later commits when\n> I am in that rolled back state?\n>\n\nIf your are on branch 'master':\n\ngit log\ngit checkout <hash of previous commit>\n\nthen\n\n\"git log master\" will show you the log from the tip of the master branch.\n\nVincent\n"}]}