I just caused a problem that I'm having trouble finding a solution for. I have been working on a year old Ruby On Rails app, which is stored in a Git repository.
I deleted many files, several commits ago, but never did a git rm filename
to remove the files from the repository.
Recently I did a git stash save --keep-index
, git stash drop
to discard some bad code and go back to the last commit. However when I did this, the deleted files which were not removed from the repository have been restored.
Now my project is crashing because of files that exist, which should not. Is there any way I can re-delete the files, or get a list of the deleted files which were restored?
I tried googling this problem, but google helpfully returns results for "git restore accidentally deleted files" which is the opposite of what I am looking for.