Just to be clear. You dont really revert "back". Say you have the following history.
A<--B<--C<--D
|
(tag:1-2-0)
Now say you revert C
. This is what happens.
A<--B<--C<--D<--E
|
(tag:1-2-0)
As you can see you have moved forward in history. If this tag has already been released, then you probably want to consider this a "hotfix", and tag again as 1-2-0-1
, or something along those lines. Not sure what your version number scheme is, so obviously just work hotfixes into your process.
Considering this change a hotfix would result in this.
(tag:1-2-0-1)
|
A<--B<--C<--D<--E
|
(tag:1-2-0)
However if you have not released or even pushed this tag up to the remote, and just want to move the tag to point to E
, then you can do this two ways. The easy to remember way is to delete the tag and recreate it.
git tag -d 1-2-0
git tag 1-2-0 E
The shorter, faster, but infinitely less friendly way to change the tag without deleting it would be to use update-ref
.
git update-ref refs/tags/1-2-0 E
In the odd case that you have pushed the tag up and want to remove it from the remote, use the following syntax.
git push <remote> :1-2-0
Assuming origin is your remote.