1

Does anyone know how to undo the reset of a branch in Intellij IDEA? In other words: is it possible to restore commits made after the current state of the branch?

It's hard to find the answer on the internet because my question gets confused with reverting the commit, which is not what I mean.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 1
    Take a look at `git reflog` so that you can see what was in the branch before (in case you are dealing with local branches). Once you have the ID of the commit you want, put the branch there. – eftshift0 Apr 26 '23 at 07:22
  • 1
    Does this answer your question? [How can I undo git reset --hard HEAD~1?](https://stackoverflow.com/questions/5473/how-can-i-undo-git-reset-hard-head1) – jonrsharpe Apr 26 '23 at 07:29

1 Answers1

2

You can right click on a file in the project pane and look at "Local History".

If you are fortunate, you can see a version of the code there that you are looking for.

vikingsteve
  • 38,481
  • 23
  • 112
  • 156