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 NOTE: this command is deprecated. Use git-fsck(1) with the option
14 --lost-found instead.
15
16 Finds dangling commits and tags from the object database, and creates
17 refs to them in the .git/lost-found/ directory. Commits and tags that
18 dereference to commits are stored in .git/lost-found/commit, and other
19 objects are stored in .git/lost-found/other.
20
22 Prints to standard output the object names and one-line descriptions of
23 any commits or tags found.
24
26 Suppose you run git tag -f and mistype the tag to overwrite. The ref to
27 your tag is overwritten, but until you run git prune, the tag itself is
28 still there.
29
30 $ git lost-found
31 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
32 ...
33
34
35 Also you can use gitk to browse how any tags found relate to each
36 other.
37
38 $ gitk $(cd .git/lost-found/commit && echo ??*)
39
40
41 After making sure you know which the object is the tag you are looking
42 for, you can reconnect it to your regular .git/refs hierarchy.
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 ...
56 $ git update-ref refs/tags/not-lost-anymore 1ef2b196
57 $ git rev-parse not-lost-anymore
58 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6
59
60
62 Written by Junio C Hamano <gitster@pobox.com[1]>
63
65 Documentation by Junio C Hamano and the git-list
66 <git@vger.kernel.org[2]>.
67
69 Part of the git(1) suite
70
72 1. gitster@pobox.com
73 mailto:gitster@pobox.com
74
75 2. git@vger.kernel.org
76 mailto:git@vger.kernel.org
77
78
79
80Git 1.7.1 08/16/2017 GIT-LOST-FOUND(1)