Going Back to a Previous Git Commit in Xcode

March 12th, 2018

Filed under: Version Control, Xcode | Be the first to comment!

Something that can happen to you when using version control is you commit a change to the version control repository, realize you made a mistake, and want to go back to an earlier commit. How do you do this in Xcode?

Xcode provides no direct way to go back to an earlier commit. What you have to do is create a branch off the earlier commit and work off that branch.

Open the source control navigator by choosing View > Navigators > Show Source Control Navigator. Select the current branch from the source control navigator. The Xcode editor shows all the commits for that branch.

XcodeCommitList

Select the commit you want to use, right-click, and choose Branch from CommitNumber. The commit number is a long hexadecimal number. Name the branch and click the Create button. Now you’re working from the earlier commit.

Learn More About Version Control

Tags: ,


Leave a Reply

Your email address will not be published. Required fields are marked *