tg-revert.sh: keep matching tags when reverting
When `tg tag` stores refs it only ever stores ref names that point
to commits.
If `tg tag` has been told to store an annotated/signed tag that
points to a commit, it will emit a warning and store it as a
lightweight tag instead (i.e. dereference it to the commit and store
that).
When reverting, if the ref being reverted actually refers to a `tag`
object that dereferences to the same commit object which would be
restored, then leave that ref alone.
The effect will be essentially the same -- that ref when used as a
committish will still produce the same commit object, but this way
tag objects do not needlessly get downgraded.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>