By mistake I used git add .
so all files are added in staring area. I want to remove all those files from staring area.
I tried
git clean -fdx
git clean -df
but it isn't worked.
The easiest way to delete a file in your Git repository is to execute the “git rm” command and to specify the file to be deleted. Note that by using the “git rm” command, the file will also be deleted from the filesystem.
Just run the rm command with the -f and -r switch to recursively remove the . git folder and all of the files and folders it contains. This Git repo remove command also allows you to delete the Git repo while allowing all of the other files and folder to remain untouched.
You can also do like this:
git reset . <-- will remove files from current index
git reset <filename> <-- for a specific file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With