Skip to content

Git Head

Kenneth Kasajian edited this page Aug 8, 2014 · 7 revisions

Checkout a commit using a commit Id

git checkout <commit Id>

Checkout parent of a commit

git checkout <commit Id>^

or

git checkout <commit Id>~1

Checkout grand-parent of a commit

git checkout <commit Id>^^

or

git checkout <commit Id>~2

Checkout grand-parent of a master

git checkout master^^

or

git checkout master~2

Move master branch to commit Id or branch

git checkout master
git reset <commit Id>

or

git checkout master
git reset bugFix

or

git branch -f master <commit Id>

or

git branch -f master bugFix

References