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