2020-12-28
git rm --cached {file}
git commit --amend
例
$ git log --name-status
A content/blog/2020/2020-12-17___sort-without-head.md
A content/blog/2020/2020-12-28___undo-commited-new-file.md
2020-12-28___undo-commited-new-file.md
を間違えてコミットに含めてしまいました。
$ git rm --cached content/blog/2020/2020-12-28___undo-commited-new-file.md
$ git commit --amend
$ git log --name-status # 確認
A content/blog/2020/2020-12-17___sort-without-head.md
$ git status
Untracked files:
(use "git add <file>..." to include in what will be committed)
content/blog/2020/2020-12-28___undo-commited-new-file.md