I've made a commit and a tag (using git tag -a -m ). I found out before I pushed that I needed to revert the commit so I used git revert --soft HEAD~
. How do I also remove the tag? I've checked with git push --tags --dry-run
that it hasn't been pushed yet, so I hope it's possible to remove.
Undo tag that's not pushed in Git
Just run the following command from the branch where you created the tag:
git tag -d <tag name>
Even if you pushed the tag already it is still possible to remove it. Check out this useful blog post.
In case that (very helpful) blog post goes away, the syntax for deleting the remote tag is:
git push origin :refs/tags/<tag name>
–
Cumuliform © 2022 - 2024 — McMap. All rights reserved.
--soft
flag forgit revert
. Did you meangit reset
? – Kindness