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