How can I unstage my files again after making a local commit?

前端 未结 7 778
灰色年华
灰色年华 2020-12-22 16:16

I have executed the following command

git add 
git commit -m \"add the foo.java file\"

How can I delete my local commit now

7条回答
  •  有刺的猬
    2020-12-22 16:43

    To me, the following is more readable (thus preferable) way to do it:

    git reset HEAD~1
    

    Instead of 1, there could be any number of commits you want to unstage.

提交回复
热议问题