git addの取り消しと、コミット済みのファイルを除外する方法 - kanonji’s diary

git addを取り消す $ git reset HEAD foo.txt git add で編集内容が index に追加*1されます。 間違えて index に追加した場合に、このコマンドで取り消しができます。 $ git add foo.txt $ git status # On branch master # Changes to be committed: # (use "git reset HEAD <file>..." to unstage) # # modified: foo.txt # $</file>…