git add -u git reset -- main/dontcheckmein.txt where main/dontcheckmein.txt is the unwanted file.
git add --all -- ':!path/to/file1' ':!path/to/file2' ':!path/to/folder1/*'