To back out changes to a file incrementally, choose Edit > Undo change. The Undo command is contextualized by your last operation. For example, the command appears as Undo Typing if you make an edit to an implementation file; the command changes to Undo Add Button if you add a button object to a storyboard.
With the Undo command, you can back out every change to a file since the start of your editing session. An editing session begins when you open a project and ends when you close the project. Xcode lets you undo all the edits in that session, even those already saved to disk. (Note, however, that the Revert Document command clears the Undo history, and you cannot undo a revert operation.)
After you’ve chosen the Undo command, you can choose Edit > Redo to reverse the last undo operation.