Recovering Accidental Storyboard Deletion

前端 未结 9 665
[愿得一人]
[愿得一人] 2020-12-20 11:56

I tried looking for the answer but didn\'t find it.

I accidentally deleted my storyboard in XCode4. Is there anyway that I can retrieve it? I looked in the trash ca

9条回答
  •  忘掉有多难
    2020-12-20 12:46

    I just did the same. It was pretty easy to recover if you were using git (and there was not much change from the last commit).

    All you have to do is to restore your project.pbxproj file. Try git diff your .xcodeproj/project.pbxproj

    Once you confirm that restoring that file will save your storyboard (since you will find deleted lines around MainStoryboard), run this simple command:

    git checkout project.pbxproj
    

    If you made some change to the project (like adding files) since the last commit, you will find some added lines as well. Save them by running git diff before above command.

提交回复
热议问题