Git Tip : Restore a deleted tag

A little tip that can be very useful, how to restore a deleted Git tag.

If you juste deleted a tag by error, you can easily restore it following these steps. First, use

git fsck --unreachable | grep tag

then, you will see the unreachable tag. If you have several tags on the list, use

git show KEY

to found the good tag and finally, when you know which tag to restore, use

git update-ref refs/tags/NAME KEY

and the previously deleted tag with restore with NAME.

Thanks to Shawn Pearce for the tip.

Related articles

  • Version Control with Git – Book Review
  • JTheque is migrating to Git
  • Tip : How to solve “agent admitted failure to sign using the key” error ?
  • Play Framework - The template engine
  • budgetwarrior 0.3.1 - Git versioning and easier creation
  • pm 0.1.1 - A simple workspace manager for Git projects
  • Comments

    Comments powered by Disqus