I was using Eclipse
and Egit
for a long time and decided to try Intellij
.
So far so good, except one thing...
I can't find an easy way to revert an old commit from my repo!!!
In Eclipse the standard process was: Go to Git Workspace -> Click Show History(Right Click Project) -> RIght-Click on the commit I want to revert and press Revert Commit.
In Intellij I can't find anything equivalent. Tried VCS -> Show Changes View
but there I can only cherry pick
a commit. I also played with the revert option under VCS -> git
but got confused by the changelist
thing(That may hide the answer, but I don't understand how it works).
I can still revert the commit by issuing git revert <sha>
from terminal but that's what I was trying to avoid in the first place by using git from Intellij and not pure terminal.
Is there a way to do easily the revert in Intellij?
For most recent changes, including refactorings, press Ctrl+Z or choose Edit | Undo from the menu.
If you go to Changelist -> Log, and there select the commit, you've got a change detail in the right panel. There you can select all and click a button (or right click -> revert selected changes).
I know of only one way and it's not as good as doing it command line.
First create a reverse patch. Go into the log, choose any commit and select create patch
, check reverse patch
and save it anywhere.
Then go into VCS menu and select apply patch
and choose the file you just saved.
Commit those changes.
Still, I would go with doing it command line. Gives a proper automatic commit message as well.
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