All fixes

Help, I tagged the wrong commit

Move a tag to the right commit, locally and on the remote.

What Git says~/my-app
git tag v1.0 a1b2c3d
fatal: tag 'v1.0' already exists

The fix

  1. git tag -d v1.0

    Deletes the tag. Git prints which commit it pointed to.

  2. git tag v1.0 a1b2c3d

    Creates the tag again, on the right commit.

v1.0 is an example. Replace it with your own.

What happens to your history
BeforeABCv1.0HEADmain
AfterABCHEADmainv1.0

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.