How to checkout a commit's child?

Viewed 3435

How do I reference a commit ahead of HEAD?

For example, a commit that is 1 commit behind HEAD is HEAD~1.

How do I move the opposite direction, with respect to HEAD?

Basically, I did a git checkout HEAD~1 3 times. Now I want to move forward 1 commit, effectively undoing my last git checkout HEAD~1. How can I do this?

I understand that a branch of commits is like a singly linked list, with each commit only pointing to its parent. So if it unreasonable to traverse to a commit's child, I would like to know how to process forward between them.

4 Answers
Related