I have executed the following command

git add <foo.java>
git commit -m "add the foo.java file"

How can I delete my local commit now and unstage foo.java?

If I type git reset --hard, I found that it reverts my modified foo.java to the original one.

7 Answers
7

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *