Help, I tagged the wrong commit
Move a tag to the right commit, locally and on the remote.
git tag v1.0 a1b2c3d fatal: tag 'v1.0' already exists
The fix
git tag -d v1.0Deletes the tag. Git prints which commit it pointed to.
git tag v1.0 a1b2c3dCreates the tag again, on the right commit.
v1.0 is an example. Replace it with your own.
git tag -d v1.0Deletes the tag locally.
git tag v1.0 a1b2c3dCreates it again on the right commit.
git push origin --delete v1.0Deletes the old tag on the remote.
git push origin v1.0Pushes the corrected tag.
v1.0 is an example. Replace it with your own.
Before
After
Why this works
Tags are meant to stay put, so Git will not move one silently. You delete it and create it again. Was the old tag annotated, with a message? Recreate it with git tag -a v1.0 a1b2c3d -m "Release 1.0". Teammates who already fetched the old tag keep it until they run git fetch --tags --force.