# Undoing a refactoring operation

The most recent refactoring can be undone as long as you have not modified any Java elements in the workbench. After performing a refactoring operation, you can build the project, run and debug it, and execute any test cases, and still undo the refactoring action.

To undo the most recent refactoring, select Refactor > Undo from the menu bar.

Note: If the workbench contains unsaved files that affect undoing the refactoring, an error dialog appears. The dialog contains a list of files that must be reverted to their saved editions before the refactoring can be completed.

Refactoring support

Refactoring without preview
Refactoring with preview
Previewing refactoring changes
Redoing a refactoring operation

Refactoring actions
Refactoring dialog
Refactoring preferences