Where is the 'Revert' option in Xcode 4's Source Control?
Asked Answered
D

4

7

I'm using SVN in Xcode 4 as my source control; but can't see any option to revert to an older revision? Either a 'revert' or an 'update to revision' command? The 'Update' option always seems to update to the HEAD.

Of course - I can do this on the command-line, but can't believe there's no way to do it within Xcode...

Does anyone know where it's hidden? Or is there really no such option?

Doormat answered 24/3, 2011 at 10:23 Comment(0)
P
12

Unfortunately the SCM functionality in 4.0 is fairly limited. You can commit, switch branches, branch/merge, diff previous versions, update to HEAD, but you can't revert.

We all expect this to get better in successive updates but it does seem like a rather silly omission. The Time-Machine-like diff version picker seems the perfect place to put the UI, so I'd expect it to appear there when it's finally supported.

Peculiarize answered 24/3, 2011 at 12:3 Comment(2)
Yes, the SCM chapter of my forthcoming Xcode book is going to be disappointingly short. :-}Peculiarize
Update: SCM integration has come a long way since Xcode 4.0. See the Xcode documentation for the current set of SCM functionality. For many smaller independent developers, it's more than enough to keep track of their projects. It's still a little scary trusting it with merging multiple developer change sets, though. There are definitely better Mac tools for that.Peculiarize
P
3

You can "Discard Changes". That will revert the selected file(s).

Pelisse answered 24/3, 2011 at 18:57 Comment(2)
Not to a particular revision, only to the head as Wex mentioned.Peculiarize
Also it will not allow you to undelete files.Garish
I
2

Just a work around: As it isn't possible to revert with Xcode - you could use any SVN tool e.g Tortoise on a Windows machine and this Tutorial.

If you just need to compare a method or so you could also just simply compare to an older version by going to Organizer -> Respositories -> Your Project -> below in the history click the file -> View Changes. (Xcode 4)

If you screw up your project file you could still go oldschool and copy a working revision of the file to an usb stick by using Tortoise and replacing it in your project. That's what I just did ;)

Iridotomy answered 7/2, 2013 at 9:9 Comment(0)
H
0

This is kinda old question, but I manage to find a way to find and revert to old versions. As it is a Mac built in feature, not a xcode thing, it will find ALL saved versions of a specific file. But it can save you on hard times, like it saved me :~

How to revert/recover .m file to a previous version? (autosaved blank by mistake and xcode crashed - no Source Control, no Time Machine)

Summing up: I've opened the "file.m" I need to recover with TextEdit. Then I browse to:

File > Revert To > Browse All Versions

There I manage to find all versions of the file and could pick the one that I need.

Hebron answered 7/12, 2015 at 23:10 Comment(1)
@kleopatra ok, did it! Tnks!Whine

© 2022 - 2024 — McMap. All rights reserved.