forum/Revert to a precedent state in direct modegit-annexhttp://git-annex.branchable.com/forum/Revert_to_a_precedent_state_in_direct_mode/git-annexikiwiki2014-12-01T23:35:22Zcomment 1http://git-annex.branchable.com/forum/Revert_to_a_precedent_state_in_direct_mode/comment_1_1ae9f7defbab44621c3108973a4f683a/joeyh.name2014-06-04T19:03:05Z2014-06-04T19:03:05Z
<p>I wish that I had a good answer for you, but since you're using direct mode, I really do not!</p>
<p>You can run this to see the status:</p>
<pre><code>git -c core.bare=false status
</code></pre>
<p>That's safe. Everything below has a good chance of losing data if not used carefully.</p>
<p>You can run a command like this to <em>delete</em> an unwanted file (that is shown as a new file in the above).</p>
<pre><code>git -c core.bare=false rm -f unwanted_file
</code></pre>
<p>If the status shows a file as being modified, you can run this to throw away the modified version. This does not put back the old version! It will leave you with a broken symlink.</p>
<pre><code>git -c core.bare=false reset modified_file
git -c core.bare=false checkout modified_file
git annex fsck
</code></pre>
<p>If you're lucky, you can then <code>git annex get</code> to get the old version from some other repository that still has it.</p>
How about with the 'proxy' command?http://git-annex.branchable.com/forum/Revert_to_a_precedent_state_in_direct_mode/comment_2_0bcfc0e89de7072bfdf1e3cdeaa16a1b/Jarno2014-11-28T18:47:17Z2014-11-28T18:47:17Z
<p>Why does this not work?</p>
<pre><code>git annex proxy -- git reset HEAD
</code></pre>
comment 3http://git-annex.branchable.com/forum/Revert_to_a_precedent_state_in_direct_mode/comment_3_e49a37f92a3dd7d386e1e5f37ab37df4/joey2014-12-01T23:35:22Z2014-12-01T22:40:05Z
<p>Yes, the new <code>git annex proxy</code> command was added partly thanks to this
thread, and you can use it like that.</p>
<p>There's also a new <code>git annex undo</code> command that's easier to use than the
proxy command. It just undoes the last change you made to the file or
directory you specify.</p>