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

时间秒杀一切 提交于 2019-11-29 10:18:09

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.

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

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 ;)

ゴスエン ヘンリ

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!