In Git Bash I mistakenly wrote directly the command:
add .
without first having put the command cd y el nombre de mi proyecto
.
For this reason, when opening visual studio in Team Explorer, the C:\Users\ folder was loaded with all the files (which are thousands of files).
How do I cancel it from git Bash or directly from visual?
In Git Bash you can use
git reset
. This will 'unset' all the files you have added after your last commit.If you want to delete only some files, use
git reset -- <file 1> <file 2> <file n>
.It is also possible to delete some of the changes to the files using
git reset -p
.With new versions of Git you can say:
Full example adding a "hello" file: