On Sunday, September 14, 2014 5:04:18 AM UTC-4, André Hänsel wrote:
> I ran git merge to merge a branch. There were some conflicted files. 
> Although they were automatically resolved by git rerere, I still had to add 
> them. I accidentally ran "git add ." instead of "git add -u". I noticed my 
> mistake and ran "git merge --abort" to start over. To my dismay all my 
> untracked files are gone! Any way to get them back?

The "git add ." should have created Git objects for these untracked files. 
When you did the "git merge --abort", you reset the working directory, 
deleting those files, but the Git objects should still be hanging around. 
At least this is what I observed trying to reproduce your issue. 

If you felt like plumbing the depths of the .git/object  directory, try to 
sort the files in that directory in reverse chronological order. The most 
recent files are probably the files that were deleted. You can confirm this 
by using the git show command. Example: if you have this file:


you should be able to view its contents with git show 96040df.

Once you can view them, then save them away in their original files. 
Ideally you don't have too many files. Let us know if this works!
Rick Umali  /  www.manning.com/umali

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to