In Intellij IDEA, how can I reload the contents of a file from disk?

In vim, I can type :e and reload the contents of the file from disk, overwriting all the changes I made. This is a good way to reset in case I am lost or just want to undo all my changes. This, obviously, does not take into account any refactoring, I just want to destroy all the changes in the buffer. Even closing and reopening a tab will not work.

How do I do this with Intellij IDEA? I am using Intellij IDEA Ultimate 13 and I have disabled any auto save.

+8
intellij-idea
source share
5 answers

What am I doing in a similar situation:

  • Simple - Ctrl + Z , Ctrl + Shift + Z many times to quickly jump to edit history
  • Rollback VCS - either for the entire file or for the editable area (by clicking the green areas on the left)
  • Local history. Well, yes, that’s not enough for you, so there may be an option first

There is also the option to put a shortcut in Local History if you need to roll back to a specific point in time.

For those who use autosave, it starts when the code editor loses focus. Therefore, running Alt-Tab during long-term editing without compiling or running code makes sense.

+4
source share

File> Synchronize ( Ctrl + Alt + Y ) It will download the file from the file system. If you have unsaved changes, he will ask if you want to cancel them.

+15
source share

βŒ₯⌘Y - sync for Mac users

enter image description here

+4
source share

Open the file in another editor, make minor changes and save it. PHPStorm will ask you what to do, since the file system and the copies of memory in the file diverge. Click Download File System Changes.

Note that I was not able to use my cancellation history because it became corrupted.

+3
source share

Since I do not want, I wrote an extension to do this for me:

https://github.com/btipling/DiskRead/

I will add it to the Jetbrains plugin repository called DiskRead.

I wrote a post about how I created this, if anyone is interested.

0
source share

All Articles