Refactorings can be undone as long as you have not modified any Java elements in the workbench. So after performing a refactoring, you can build the project, run and debug it, and execute any test cases, and still undo the refactoring action.
You can select to undo a refactoring via the context menu of the element you changed.
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 versions before the refactoring can be completed.