1

I have accidentally clicked on revert current branch to here (used hard reset method), I want to revert it, The problem is the most recent code wasn't committed. How do I get my code back?

1 Answers1

0

Check first if you can find your modified files with the JetBrain local history feature.

Right-click anywhere in the editor and choose Local History | Show History from the context menu.

In the dialog that opens, the left-hand pane shows a list of all saved revisions of the current file with timestamps. The right-hand pane shows a diff viewer which displays the differences between each revision and the current state of the file.

It might also work for new files.

Check also if you had added to the index, but not committed, some of your work.
Using git fsck --lost-found could then help fetching the content of that work from the internal Git database.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • It just worked for me steps I followed 1: Right click on app module 2. local history - > show history -> right click on most recent external changes tab and then revert – Pritam Pawade Aug 23 '21 at 04:41