1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="git-lost-found(1)">
\r
6 <title>git-lost-found(1)</title>
\r
8 <primary>git-lost-found(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-lost-found - Recover lost refs that luckily have not yet been pruned</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git lost-found</emphasis></literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara><emphasis role="strong">NOTE</emphasis>: this command is deprecated. Use <xref linkend="git-fsck(1)" /> with
\r
24 the option <emphasis>--lost-found</emphasis> instead.</simpara>
\r
25 <simpara>Finds dangling commits and tags from the object database, and
\r
26 creates refs to them in the .git/lost-found/ directory. Commits and
\r
27 tags that dereference to commits are stored in .git/lost-found/commit,
\r
28 and other objects are stored in .git/lost-found/other.</simpara>
\r
30 <simplesect id="_output">
\r
31 <title>OUTPUT</title>
\r
32 <simpara>Prints to standard output the object names and one-line descriptions
\r
33 of any commits or tags found.</simpara>
\r
35 <simplesect id="_example">
\r
36 <title>EXAMPLE</title>
\r
37 <simpara>Suppose you run <emphasis>git tag -f</emphasis> and mistype the tag to overwrite.
\r
38 The ref to your tag is overwritten, but until you run <emphasis>git
\r
39 prune</emphasis>, the tag itself is still there.</simpara>
\r
40 <screen>$ git lost-found
\r
41 [1ef2b196d909eed523d4f3c9bf54b78cdd6843c6] GIT 0.99.9c
\r
43 <simpara>Also you can use gitk to browse how any tags found relate to each
\r
45 <screen>$ gitk $(cd .git/lost-found/commit && echo ??*)</screen>
\r
46 <simpara>After making sure you know which the object is the tag you are looking
\r
47 for, you can reconnect it to your regular .git/refs hierarchy.</simpara>
\r
48 <screen>$ git cat-file -t 1ef2b196
\r
50 $ git cat-file tag 1ef2b196
\r
51 object fa41bbce8e38c67a218415de6cfa510c7e50032a
\r
54 tagger Junio C Hamano <junkio@cox.net> 1131059594 -0800
\r
58 This contains the following changes from the "master" branch, since
\r
60 $ git update-ref refs/tags/not-lost-anymore 1ef2b196
\r
61 $ git rev-parse not-lost-anymore
\r
62 1ef2b196d909eed523d4f3c9bf54b78cdd6843c6</screen>
\r
64 <simplesect id="_git">
\r
66 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r