<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cat brain.log &#124; less &#187; file</title>
	<atom:link href="http://log.largevoid.com/tag/file/feed/" rel="self" type="application/rss+xml" />
	<link>http://log.largevoid.com</link>
	<description>Getting it down on `paper`</description>
	<lastBuildDate>Mon, 06 Feb 2012 06:23:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Git: Recovering a file that you deleted</title>
		<link>http://log.largevoid.com/2010/03/git-recovering-a-file-that-you-deleted/</link>
		<comments>http://log.largevoid.com/2010/03/git-recovering-a-file-that-you-deleted/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 21:02:36 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Lessons]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Scripts, Tricks and Hacks]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[branch]]></category>
		<category><![CDATA[checkout]]></category>
		<category><![CDATA[commit]]></category>
		<category><![CDATA[deleted]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://log.largevoid.com/?p=304</guid>
		<description><![CDATA[You might be doing some spring cleaning to your source code, or you might move files around that you think are unnecessary. Later on, you realize that one of the files you removed was a dependency. Now what? For this, we use git checkout. If this is you: ...edit files... git add edited-file git commit [...]]]></description>
			<content:encoded><![CDATA[<p>You might be doing some spring cleaning to your source code, or you might move files around that you think are unnecessary.  Later on, you realize that one of the files you removed was a dependency.  Now what?  For this, we use <code>git checkout</code>.</p>
<p>If this is you:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...edit files...
<span style="color: #c20cb9; font-weight: bold;">git</span> add edited-file
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;made changed&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">git</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> seemingly-useless-file
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;removed unreferenced dependency&quot;</span>
... edit <span style="color: #c20cb9; font-weight: bold;">file</span> ... realize you dynamically included that <span style="color: #c20cb9; font-weight: bold;">file</span> elsewhere..</pre></div></div>

<p>Then you can simply follow up with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> checkout 0a323 <span style="color: #000000; font-weight: bold;">//</span> the previous revision <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">hash</span> from <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">git</span> log<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #c20cb9; font-weight: bold;">cp</span> seemingly-useless-file seemingly-useless-file.1
<span style="color: #c20cb9; font-weight: bold;">git</span> checkout master
<span style="color: #c20cb9; font-weight: bold;">mv</span> seemingly-useless-file.1 seemingly-useless-file
<span style="color: #c20cb9; font-weight: bold;">git</span> add seemingly-useless-file
<span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Restored seemingly-useless-file&quot;</span></pre></div></div>

<p>You may want to <code>git blame</code> yourself while you&#8217;re at it.</p>
<p>If you know of a better way, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://log.largevoid.com/2010/03/git-recovering-a-file-that-you-deleted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  log.largevoid.com/tag/file/feed/ ) in 0.24250 seconds, on Feb 8th, 2012 at 3:55 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 8th, 2012 at 4:55 am UTC -->
