git add some file and ignore remaining code example
Example: git add all except one file
git add -u
git reset -- main/dontcheckmein.txt
where main/dontcheckmein.txt is the unwanted file.
git add -u
git reset -- main/dontcheckmein.txt
where main/dontcheckmein.txt is the unwanted file.