How to restore previous version of code in Xcode

Victor Engel picture Victor Engel · Jan 12, 2013 · Viewed 34.5k times · Source

I'm working on an Objective C project in Xcode and need to restore to a previous version that was committed in source control. How do I do that? I can find information on how to commit and push but no information on how to restore to an old version.

Answer

mlstudent picture mlstudent · Jan 12, 2013

You cannot revert the entire project at once in Xcode, but you could do it from the terminal; just cd into the folder of your project and type git log to find the hash you're looking for, then do git checkout [hash].