I have made some mistakes while using git annex import
in direct mode. Now I see that some files have been erroneously added and there are other problems. I have not yet used git annex sync
.
How can I tell git-annex in direct mode (or bare git) to forget about all these changes and revert back to the last known good (pre-import) state? This means also removing the few imported files and recreate their links.
I wish that I had a good answer for you, but since you're using direct mode, I really do not!
You can run this to see the status:
That's safe. Everything below has a good chance of losing data if not used carefully.
You can run a command like this to delete an unwanted file (that is shown as a new file in the above).
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.
If you're lucky, you can then
git annex get
to get the old version from some other repository that still has it.Why does this not work?
Yes, the new
git annex proxy
command was added partly thanks to this thread, and you can use it like that.There's also a new
git annex undo
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.