After checking out a branch in a repository git always prints a list of roughly 25 files that were deleted long ago. I always just ignored that output but recently I had to do a hard reset, which I assumed would just go back to the last commit, which it did but it also restored those 25 files. Is there some way of removing those files from git? I tried git rm but since they were long deleted that didn’t work!
Share
It sounds like you deleted the files from your directory, but never committed the deletions (like Bombe said, with
git rm). That’s why they came back after thegit reset.Deleting a file is just like any other change, it has to be recorded in the repository (which is what
git rm [file]will do).