Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
現在、私がそれをしなければならないとき、私が従う手順は次のとおりです。
それを行うためのより簡単な方法はありますか?
ファイルの以前の状態をチェックアウトし、コミットを修正します。
git checkout HEAD^ -- file.txt git commit --amend
コミットログメッセージを修正する必要がない場合、最後のコマンドは
git commit --amend -C HEAD
エディターを開いてコミットログを編集することさえせず、修正するだけです。