I tagged my master branch with a git tag -a 1.0.0 and I would like to do is reset my master branch with reset --hard to the commit that the tag points to. My questions.
- How to find out the commit id that a tag points to?
- How to reset the head of a branch to the commit pointed to by a tag?
You can just pass the tag name to
git resetto reset to the commit pointed to by that tag name:git reset --hard 1.0.0.If you still want the commit hash, you can get it with
(
git show 1.0.0will also do; the above dumps only the commit hash.)