I'm using PHPStorm and have a problem.
I've committed few files in PHPStorm (cmd+k). But it was a mistake and i shouldn't push'em. Now i don't understand, how to reset/delete that commit from phpstorm.
I used git reset --hard at Terminal, but nothing changed in PHPStorm - commit's still there. I can see it, if i'm trying to push (shift+cmd+k), then I see all previous commits.
As long as the commit has not made it upstream yet, a command-line solution would be:
git reset HEAD^
The HEAD^
refers to the last commit before HEAD
. HEAD
represents the latest commit. When you use git reset
without another argument, it resets to the latest commit. But that's exactly the point you're already at.
Adding --hard
cleans up the added/edited files from your working directory. Decide for yourself if that's something you want.
I have a Git button on the left-bottom of the IDE, if I click it I can see both my local and remote branches. If you click on a branch you can see all the commits in a timeline and you can delete them by just right-clicking on them and select Undo commit. Notice that you have to delete them in the order you added them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With