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
Even if you deleted your main story board, it would be there inside the folder called Base.lProj
(This folder will be in the folder where your source and header files lie in the normal case.)
So go to Xcode. Right click in the Project navigator in the left side tab and add these files to the project again.
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.
If it popped up that means you can find it in your project folder. Just look in /projectName/projectName/Base.lproj. The storyboard is there. You can drag it into Xcode and its as good as new.
If you really deleted the file (check in the file system, not just in XCode, see Liam's answer below for the location) and it's not in the trash, there are (afaik) really only two options;
When undeleting, the more you use your disk after deleting a file, the less chance of recovery, so if you're really serious, you should install the program on another Mac and move the disk to that for recovery so that you won't overwrite anything.
I had the same problem, I localized my storyboard and and failed at checking the wright option that leaded to only one storyboard.string file and my original storyboard was deleted by xcode. Hopefully, the original storyboard file was put un the trash so I was able to restore it. Perhaps now the new XCode 8 version puts the file int the trash by default.
If you have committed before that happened, you can go old commit and copy storyboard's source code, and then you can create new storyboard and paste this code on it.