Local history/revision of files in Xcode Aasim Naseem, February 24, 2013 | Read Count: 12,514April 9, 2025 Category: My Tutorials > iOSHello friends .. hope things are going good on your desk .. Last night I was going through my tweets, and there I found something really interesting; I crawled it for few minutes and after reading some blog posts I came to know about a very useful but hidden feature that I always miss in Xcode .i.e. local history/revision of your code files; (What!! what did you say!!! Say again … ) Surprised !! Ya its natural; I was too when I first tested this feature; Oliver Drobnik first highlighted this feature in his blog post here after discussing with some Apple engineer. Infact Xcode autosaves the versions of all of your code files you created inside your project; (oh waoo, why I did never know this before? That sounds great) You can view those revisions with respect to their time, compare them and can revert any file to your desire revision; You can even delete a revision to cleanup version history; (man, enough; I can’t wait more, Tell me where is that option? File menu, edit, project? in which menu? ) Well, unlike eclipse (a well know editor to develop java based applications) Xcode doesn’t provide any viewer to view those revisions; (What!! are you in your senses!! No viewer? Then why the Xcode saves those revisions if it doesn’t allow us to view them? No man you are kidding han!!) No, I’m not kidding, its true; Xcode doesn’t provide any viewer to view those revisions; The questions why Xcode saves them, is still unanswered to me; But hold your breath, there is always a back door to step into home; (: We shall use TextEdit application to view and restore those revisions; (TextEdit application!!! Man you know what, too many surprises in a row are injurious to health; Take care of me bro please) To view the revision of any file, open it in TextEdit and chose File -> Revert Document option; You will see the current version and all previous revisions side by side as shown in below screenshot; click to enlarge I think the layout is pretty self descriptive; Select the revision from timeline at right and Restore it; To delete any revision just click the file name in title bar and select Delete Revision option; (Yess, its showing me complete history, from the day when I created this file; Thumbs up bro, +1) Usage: Sometimes when you are working on a module or fixing a bug, soon you feel that you have messed up all the code; Even the previously implemented thing are not working now; You try to undo your changes but you aren’t sure what was the stable state of your code; Don’t worry; Just take a sip of coke and revert your code; Simple enough; You can do it by reverting your code to, let say, the code of 2 hours before, or the code state at day end of yesterday; Smiling han!!! You should; (: Happy development; Next Step: File a feature request at Apple development forum to add viewer to view, compare and restore the revisions; (Ya they should add such viewer inside the Xcode; I’m gone add my ticket there) Author Profile Aasim Naseem Hey, Thanks for your interest. I’m a PMP, AWS Solutions Architect, and Scrum Master certified professional with 17+ years of hands-on experience leading projects, building teams, and helping organizations deliver software solutions better, faster, and smarter. Outside of work, I’ve got a deep curiosity for history — especially ancient civilizations like Egypt. I also enjoy reflecting on the everyday moments that shape how we live and work. This blog is my space to share insights, lessons, and thoughts from both my professional journey and personal interests. Thanks for reading — and I hope you will find something here that matches your interest. Latest entries IslamJune 6, 2025 | Read Count: 305Economic impact of Eid-ul-Adha PMP CertificationMay 23, 2025 | Read Count: 507Best PMP Study Resources for 2025 (Books, Courses, Tools & More) Agile & FrameworksMay 7, 2025 | Read Count: 483Agile vs Scrum: Finally Understanding the Difference Agile & FrameworksApril 25, 2025 | Read Count: 510When Not To Use Agile: 5 Signs You Need a Different Approach iOS Eclipsefile revision in Xcodelocal history in Xcodelocal history objective cxcode
iOS Integrate AdMob in iOS Application; January 10, 2012 | Read Count: 13,495April 27, 2025 Category: My Tutorials > iOSHello Everyone; Hope winters are going good around you; Today’s menu is again simple and short; We’ll learn how to integrate AdMob in an iOS application. I will show you the easiest way to integrate AdMob in the application. So lets start; Author Profile Aasim Naseem Hey,… Read More
iOS Storage Issue with iOS-5 And iCloud; February 2, 2012 | Read Count: 13,489April 27, 2025 Category: My Tutorials > iOSHello everyone .. Now a days, we are noticing that many people are getting rejection from AppStore due to storage issue; I looked into this issue and here are my findings regarding iOS-5 and iCloud; When we install our application in device, we have three main directories… Read More
iOS Getting a Screen Capture of UIView August 22, 2011 | Read Count: 14,438April 27, 2025 Category: My Tutorials > iOSSome times you have to capture a portion of you iPhone application programmatically; The quickest way is to pass the target view to following method and get its screenshot as an UIImage; Author Profile Aasim Naseem Hey, Thanks for your interest. I’m a PMP, AWS Solutions… Read More
literally a LIFESAVER, git reset –hard had almost lost me hours of work and nothing had been helping, until I tried this. Thanks so much. Reply
Dude, you saved my life !!!!!!! I lost some important code in XCode, but now it’s restored ! thank you so much ! Reply