I have executed the following command
git add git commit -m \"add the foo.java file\"
How can I delete my local commit now
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.
1