unpack-objects desperately salvages objects from a corrupt pack
[git/mergetool.git] / Documentation / git-lost-found.txt
blobf52a9d7f680e3c581fe555f5a167b68c70c0a057
1 git-lost-found(1)
2 =================
4 NAME
5 ----
6 git-lost-found - Recover lost refs that luckily have not yet been pruned
8 SYNOPSIS
9 --------
10 'git-lost-found'
12 DESCRIPTION
13 -----------
14 Finds dangling commits and tags from the object database, and
15 creates refs to them in .git/lost-found/ directory.  Commits and
16 tags that dereference to commits go to .git/lost-found/commit
17 and others are stored in .git/lost-found/other directory.
20 OUTPUT
21 ------
22 One line description from the commit and tag found along with
23 their object name are printed on the standard output.
26 EXAMPLE
27 -------
29 Suppose you run 'git tag -f' and mistyped the tag to overwrite.
30 The ref to your tag is overwritten, but until you run 'git
31 prune', it is still there.
33 ------------
34 $ git lost-found
35 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
36 ...
37 ------------
39 Also you can use gitk to browse how they relate to each other
40 and existing (probably old) tags.
42 ------------
43 $ gitk $(cd .git/lost-found/commit && echo ??*)
44 ------------
46 After making sure that it is the object you are looking for, you
47 can reconnect it to your regular .git/refs hierarchy.
49 ------------
50 $ git cat-file -t 1ef2b196
51 tag
52 $ git cat-file tag 1ef2b196
53 object fa41bbce8e38c67a218415de6cfa510c7e50032a
54 type commit
55 tag v0.99.9c
56 tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
58 GIT 0.99.9c
60 This 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
64 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6
65 ------------
67 Author
68 ------
69 Written by Junio C Hamano 濱野 純 <junkio@cox.net>
71 Documentation
72 --------------
73 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
76 GIT
77 ---
78 Part of the gitlink:git[7] suite