I accidentally deleted a file from a git-annex repository with a plain "rm". How can I restore it from other repositories that have it?
I tried using
git annex copy --from $REMOTE $REMOVED_FILE
but git-annex complaints about
$REMOVED_FILE not found
I suppose that I could switch to indirect mode and do checkout and older version, but I'd prefer not to. My repository contains thousands of quite big files; it would take a lot of time and the probability of something going wrong during the conversion is quite high (see other bugs reported during import).
I'm using git-annex 5.20141024-g613f396.
I don't know what bugs you speak of. If the probability of something going wrong is quite high, then you must have a reproducible test case. Submit a bug with such a test case, and I can fix it.
A new
git annex proxy
command was just added that allows safely running commands likegit revert
in a direct mode repsitory.So, you might do:
The sync is needed to commit the deletion, and then that commit gets reverted. Finally, you can use git-annex get to download the file from some other repository that still has a copy. (Assuming you didn't delete the last copy.)