git add -u
git reset -- main/dontcheckmein.txt
Note: Git has subsequently added special syntax for this, which is explained in other answers.
More Related Contents:
- How do I undo 'git add' before commit?
- How can I add a blank directory to a Git repository?
- Message ‘src refspec master does not match any’ when pushing commits in Git
- Difference between “git add -A” and “git add .”
- Undo git reset –hard with uncommitted files in the staging area
- Removing multiple files from a Git repo that have already been deleted from disk
- git add * (asterisk) vs git add . (period)
- Recover files that were added to the index but then removed by a git reset
- What’s the difference between `git add .` and `git add -u`?
- How do I add an empty directory to a Git repository?
- Removing multiple files from a Git repo that have already been deleted from disk
- Git add only all new files, not modified files [duplicate]
- What’s the difference between HEAD^ and HEAD~ in Git?
- What does FETCH_HEAD in Git mean?
- Permission denied (publickey) when deploying heroku code. fatal: The remote end hung up unexpectedly
- Can I get a list of files marked –assume-unchanged?
- Using conditional configuration files with Git
- How to fix committing to the wrong Git branch?
- List files in local git repo?
- What is the Sign Off feature in Git for?
- Git push rejected “non-fast-forward”
- Renaming branches remotely in Git
- What is difference between ‘git reset –hard HEAD~1’ and ‘git reset –soft HEAD~1’?
- How can I mark a committed file as read-only in Git?
- How to clone git repository from its zip
- What constitutes a merge conflict in Git?
- git branch permissions
- How can I reduce the ever-increasing time to push a subtree?
- Getting a list of all children of a given commit
- GitHub Api download zip or tarball link