Merge branch 'rs/archive'
[git/builtin-gsoc.git] / Documentation / git-lost-found.txt
blobe48607f008395e365800b82d52eda9854519a6ce
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 the .git/lost-found/ directory.  Commits and
16 tags that dereference to commits are stored in .git/lost-found/commit,
17 and other objects are stored in .git/lost-found/other.
20 OUTPUT
21 ------
22 Prints to standard output the object names and one-line descriptions
23 of any commits or tags found.
25 EXAMPLE
26 -------
28 Suppose you run 'git tag -f' and mistype the tag to overwrite.
29 The ref to your tag is overwritten, but until you run 'git
30 prune', the tag itself is still there.
32 ------------
33 $ git lost-found
34 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
35 ...
36 ------------
38 Also you can use gitk to browse how any tags found relate to each
39 other.
41 ------------
42 $ gitk $(cd .git/lost-found/commit && echo ??*)
43 ------------
45 After making sure you know which the object is the tag you are looking
46 for, you can reconnect it to your regular .git/refs hierarchy.
48 ------------
49 $ git cat-file -t 1ef2b196
50 tag
51 $ git cat-file tag 1ef2b196
52 object fa41bbce8e38c67a218415de6cfa510c7e50032a
53 type commit
54 tag v0.99.9c
55 tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
57 GIT 0.99.9c
59 This contains the following changes from the "master" branch, since
60 ...
61 $ git update-ref refs/tags/not-lost-anymore 1ef2b196
62 $ git rev-parse not-lost-anymore
63 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6
64 ------------
66 Author
67 ------
68 Written by Junio C Hamano 濱野 純 <junkio@cox.net>
70 Documentation
71 --------------
72 Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.
75 GIT
76 ---
77 Part of the gitlink:git[7] suite