DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How I Run Two AI Coding Agents on One Codebase
  • Ground Truth for AI-Written Code: Why Context Matters More Than Prompts
  • Runtime FinOps: Making Cloud Cost Observable
  • Shrink a Bloated Git Repository and Optimize Pack Files

Trending

  • Your Application Has an Unindexed Attack Surface. Do You Know What’s in It?
  • When Production Stops Moving: Running Claude Code Across a Distributed Enterprise Integration Team
  • Valkey: Bringing Key-Value Databases to Enterprise Java
  • How to Test Web Accessibility Using Playwright and Axe-Core
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Git Tip : Restore a deleted tag

Git Tip : Restore a deleted tag

By 
Baptiste Wicht user avatar
Baptiste Wicht
·
Jun. 16, 11 · Interview
Likes (0)
Comment
Save
Tweet
Share
28.1K Views

Join the DZone community and get the full member experience.

Join For Free

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.

From http://www.baptiste-wicht.com/2011/06/git-tip-restore-a-deleted-tag/

Git

Opinions expressed by DZone contributors are their own.

Related

  • How I Run Two AI Coding Agents on One Codebase
  • Ground Truth for AI-Written Code: Why Context Matters More Than Prompts
  • Runtime FinOps: Making Cloud Cost Observable
  • Shrink a Bloated Git Repository and Optimize Pack Files

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook