Documentation / git-lost-found.txton commit Documentation: link in 1.5.0.2 material to the top documentation page. (c260d79)
   1git-lost-found(1)
   2=================
   3
   4NAME
   5----
   6git-lost-found - Recover lost refs that luckily have not yet been pruned
   7
   8SYNOPSIS
   9--------
  10'git-lost-found'
  11
  12DESCRIPTION
  13-----------
  14Finds dangling commits and tags from the object database, and
  15creates refs to them in .git/lost-found/ directory.  Commits and
  16tags that dereference to commits go to .git/lost-found/commit
  17and others are stored in .git/lost-found/other directory.
  18
  19
  20OUTPUT
  21------
  22One line description from the commit and tag found along with
  23their object name are printed on the standard output.
  24
  25
  26EXAMPLE
  27-------
  28
  29Suppose you run 'git tag -f' and mistyped the tag to overwrite.
  30The ref to your tag is overwritten, but until you run 'git
  31prune', it is still there.
  32
  33------------
  34$ git lost-found
  35[1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
  36...
  37------------
  38
  39Also you can use gitk to browse how they relate to each other
  40and existing (probably old) tags.
  41
  42------------
  43$ gitk $(cd .git/lost-found/commit && echo ??*)
  44------------
  45
  46After making sure that it is the object you are looking for, you
  47can reconnect it to your regular .git/refs hierarchy.
  48
  49------------
  50$ git cat-file -t 1ef2b196
  51tag
  52$ git cat-file tag 1ef2b196
  53object fa41bbce8e38c67a218415de6cfa510c7e50032a
  54type commit
  55tag v0.99.9c
  56tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
  57
  58GIT 0.99.9c
  59
  60This contains the following changes from the "master" branch, since
  61...
  62$ git update-ref refs/tags/not-lost-anymore 1ef2b196
  63$ git rev-parse not-lost-anymore
  641ef2b196d909eed523d4f3c9bf54b78cdd6843c6
  65------------
  66
  67Author
  68------
  69Written by Junio C Hamano 濱野 純 <junkio@cox.net>
  70
  71Documentation
  72--------------
  73Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
  74
  75
  76GIT
  77---
  78Part of the gitlink:git[7] suite