delete a file on my local branch using git
I have some changes in some of my files which were already there. Then I have added a new file in it using
git add newfilename
I didn’t commited yet, Now I want to delete this new file. I can’t do the reset as it will reset all other file changes also which I don;t want.
git checkout newfilename and usual guesses
rm also but not helping.
3 Solutions collect form web for “delete a file on my local branch using git”
git reset newfilename will remove it from the index and then you can delete it as usual.
git rm --cached newfilename
To at least remove it from the index.
Just you can remove a file from your branch by using this command:
$git rm file_name