git add everything except one file code example
Example 1: git add all except one file
git add -u
git reset -- main/dontcheckmein.txt
where main/dontcheckmein.txt is the unwanted file.
Example 2: git add everything except
git add -u
git reset -- main/dontcheckmein.txt