The most recent refactoring 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.
To undo the most recent refactoring, select Refactor > Undo from the context menu in the Hierarchy, Packages, or Outline view.
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.