Search code examples
intellij-ideasearchreplaceundo

How to undo in Intellij IDEA replace in files?


In intellij 2022.1, I use Ctrl+Shift+R to bring up the Replace in Files window - it shows 100+ matches in 40+ files. The search string and the replace string differ in only one character, for example: this.bar.is.fooed and this.barf.is.fooed. I only need to replace certain instances based on nearby text.

I'm in the groove, clicking the Replace button, checking the next entry, clicking, checking, ... and thinking my brain can keep things straight (it can't; neither can yours:-) I'm halfway through when I realize the last few replaces were wrong.

How can I undo them? Ctrl+Z is grayed out. This related SO question doesn't say and neither does the JetBrains documentation!


Solution

  • Use Local History to revert the changes.

    Undo/redo is not supported for Replace dialog, vote for the related request.