1GIT-LOST-FOUND(1) Git Manual GIT-LOST-FOUND(1)
2
3
4
6 git-lost-found - Recover lost refs that luckily have not yet been
7 pruned
8
10 git-lost-found
11
13 Finds dangling commits and tags from the object database, and creates
14 refs to them in the .git/lost-found/ directory. Commits and tags that
15 dereference to commits are stored in .git/lost-found/commit, and other
16 objects are stored in .git/lost-found/other.
17
19 Prints to standard output the object names and one-line descriptions of
20 any commits or tags found.
21
23 Suppose you run git tag -f and mistype the tag to overwrite. The ref to
24 your tag is overwritten, but until you run git prune, the tag itself is
25 still there.
26
27
28
29 $ git lost-found
30 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
31
32 Also you can use gitk to browse how any tags found relate to each
33 other.
34
35
36
37 $ gitk $(cd .git/lost-found/commit && echo ??*)
38
39 After making sure you know which the object is the tag you are looking
40 for, you can reconnect it to your regular .git/refs hierarchy.
41
42
43
44 $ git cat-file -t 1ef2b196
45 tag
46 $ git cat-file tag 1ef2b196
47 object fa41bbce8e38c67a218415de6cfa510c7e50032a
48 type commit
49 tag v0.99.9c
50 tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
51
52 GIT 0.99.9c
53
54 This contains the following changes from the "master" branch, since
55 $ git update-ref refs/tags/not-lost-anymore 1ef2b196
56 $ git rev-parse not-lost-anymore
57 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6
58
59
61 Written by Junio C Hamano <gitster@pobox.com>
62
64 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
65
67 Part of the git(7) suite
68
69
70
71
72Git 1.5.3.3 10/09/2007 GIT-LOST-FOUND(1)