Reputation: 5388
I had a file, for example ~/project/config/myconfig.yml
and it was ignored by the git in the .gitignore
But now, when I have merged master
, the file got lost, deleted, and as it was never pushed to the git (as it was ignored), I can't find it in the logs.
How to restore that myconfig.yml
file?
Upvotes: 2
Views: 371
Reputation: 700
If the file was never tracked you cannot restore it!
But the main question here is what happended?
A merge cannot delete a file which is not tracked, even if the .gitignore is changed.
My guess is that you may used git stash -a or git stash --all at some point.
I would recommand you to try git stash pop which may restore previous stashed files.
This last part is just a guess but it should be given a try.
Upvotes: 2