リポジトリがロックされているように見えるこの状態を取り除くことができません。HEAD~1 にリセットした後、この単一のファイルが変更されているという通知を受け取り続けます。「追加」と「チェックアウト」は影響しません。core.autocrlf と core.safecrlf が未設定 (空) です。
下記を参照してください:
$ git --version
git version 1.7.9.6 (Apple Git-31.1)
$ git status
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: a_file_name.cpp
次のコマンド (個別に実行) は影響しません。
$ git checkout -- a_file_name.cpp
$ git reset a_file_name.cpp
$ git add a_file_name.cpp
$ git reset --hard
$ git clean -n
<nothing>
$ git clean -f
<nothing>
$ git status
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: a_file_name.cpp
そしてそれは続く...
私は何を間違えましたか?
以下の @Don の提案 (git rm) への応答、変更はありませんが、次のようになります。
$ git rm
error: 'a_file_name.cpp' has local modifications
(use --cached to keep the file, or -f to force removal)
$ git rm -f a_file_name.cpp
rm 'a_file_name.cpp'
$ git status
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: a_file_name.cpp
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: a_file_name.cpp
#
$ git commit -m"tmp"
[master 2a9e054] tmp
1 file changed, 174 deletions(-)
delete mode 100644 a_file_name.cpp
$ git status
# Your branch is ahead of 'origin/master' by 1 commit.
#
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# deleted: a_file_name.cpp
#
ほぼ sq.1 に戻ります