forum/Direct Mode - Restore file from Full Backup Repository?git-annexhttp://git-annex.branchable.com/forum/Direct_Mode_-_Restore_file_from_Full_Backup_Repository__63__/git-annexikiwiki2014-10-02T21:57:02Zcomment 1http://git-annex.branchable.com/forum/Direct_Mode_-_Restore_file_from_Full_Backup_Repository__63__/comment_1_67ac7e8b53a4374baf640d32dac79030/joeyh.name2014-09-25T15:52:04Z2014-09-25T15:52:04Z
Yes, you need to use git to either revert the repository to a previous version that had the file, or perhaps just revert the commit where the file was deleted. Either way, this requires letting git modify files in the repository, which is prevented by direct mode. So, if you can <code>git annex indirect</code> to switch to indirect mode, your git commands will work then.
comment 2http://git-annex.branchable.com/forum/Direct_Mode_-_Restore_file_from_Full_Backup_Repository__63__/comment_2_eb6df2bfcb3892ae22050a8c5f67ee90/Emre2014-09-25T19:25:06Z2014-09-25T19:25:06Z
Thanks Joeyh, of course i guess checking stuff in git would then lose my timestamps as in the previous post. I recommend, as a feature request, to make file recovery a bit easier if possible. I'm not a git expert and definitely wont use command line stuff for doing this on the long run, unless some more intuitive commands like "git annex list-old-versions" or "git annex show-deleted" and then "git annex restore "filename" version_no etc.
comment 3http://git-annex.branchable.com/forum/Direct_Mode_-_Restore_file_from_Full_Backup_Repository__63__/comment_3_15f36487383a631f16e041e2885c44ec/joeyh.name2014-10-02T15:40:40Z2014-10-02T15:40:40Z
<p>Using git does not affect the timestamps or other metadata of files stored by git-annex, which git knows nothing about. It will perhaps change the timestamps of the symlinks that git changes. It you really wanted to avoid that, you could <code>git clone</code> the repository and do all the git commands in the clone of the repository, without touching the original repo.</p>
<p>Whether commands like <code>git checkout</code> and <code>git revert</code> are intuitive depends on how intuitive you find git, I suppose. It sure seems more intuitive to me to reuse git commands that work just fine, rather than adding a whole new set of commands.</p>
comment 4http://git-annex.branchable.com/forum/Direct_Mode_-_Restore_file_from_Full_Backup_Repository__63__/comment_4_9293831aff5b6cef490f65d03638d34d/Emre2014-10-02T21:57:02Z2014-10-02T21:57:02Z
<p>If git-annex target user community are the ones with some level of git know-how, then you may be right. But I'm not one of them. The only time I use git is to clone a repo from the internet when I want to compile latest source code. Nothing more. Reverting etc are alien to me.</p>
<p>Besides, what happens if there are multiple files in a commit but you want to revert only one file? This may be a stupid question if git is able to filter files when reverting, but accept my apologies if so, since I do not know git.</p>
<p>I simply want to use git-annex to sync files, keeping some versions of the files in case needed.</p>