I have executed the following command
git add git commit -m \"add the foo.java file\"
How can I delete my local commit now
Lets say you want to unstage changes upto n commits,
Where commit hashes are as follows:
Then run the following command: git reset hn
git reset hn
Now the HEAD will be at hn+1. Changes from h1 to hn will be unstaged.