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

前端 未结 7 840
灰色年华
灰色年华 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:21

    Use:

    git reset HEAD^
    

    That does a "mixed" reset by default, which will do what you asked; put foo.java in unstaged, removing the most recent commit.

提交回复
热议问题