There are several different refactorings available. Refactorings start with a compilation and also end with a compilation. Refactoring have a separate undo functionality which allows to undo a refactoring as long as no changes have been done to the classes that have been refactored.