Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I restore from a previous commit on Xcode 8?

Let's say I have 5 local commits:

  • commit 1
  • commit 2
  • commit 3
  • commit 4
  • commit 5

At this point when I'm working, I'd like to go back to commit 2.

How would I do so?

This was so easy using snapshots in previous versions of Xcode.

"Discard changes" only goes back to commit 5, right?

like image 1000
Mestwick Avatar asked Jan 05 '23 02:01

Mestwick


1 Answers

In Xcode 9:

  1. Choose Source Control navigator.
  2. Select (branch) committed project.
  3. Click "Editor->Checkout ...", or click "Editor->Branch->Checkout ..."

This works for me, it restores the entire project at once.

like image 150
user3537954 Avatar answered Jan 12 '23 20:01

user3537954