When you call Repository::checkout with a tag (eg. 0.1.0) and the working directory is empty. Git creates a clone with only the 0.1.0 tag and locks the tag within the fetch configuration.
This way you won't be able to switch to for example the master branch.
A possible solution would be to update the configuration of the git clone by executing a git config command:
git config remote.origin.fetch "+refs/heads/master:refs/remotes/origin/master"