Check out the required commit when ref is not HEAD

Currently ref in git versioner is not really working because it won't check out the required commit when ref is not HEAD.