I have a rails project and I did the following steps:
git commit -m "Format gemfile"
andgit push
to make sure everything is clean. The id of this commit is b24d101git checkout -b newbranch
While on the new branch I deleted a file, made changes to 2 other files and generated several other files.
git status
I have 2 files modified, 1 file deleted and several files untracked. So far so good.I noticed a problem, so I moved back to the master branch via
git checkout master
and deleted the newbranch viagit branch -d newbranch
.git status
still shows that there are several untracked files.I decided to revert to my last commit.
git reset --hard b24d101
git status
now shows that no files are deleted or modified (and indeed I can confirm this after a manual check, the deleted file from step 3 is there, the edits on the 2 files from step 3 are gone). However I still have these several untracked files. I don't want them. Isn't git supposed to delete these files since they were created: a) on a new branch, which no longer exists and was not merged before deletion, and b) after the commit I reverted to?
P.S. Am I suppose to "clean" these files manually?