1

I added a image template or something like that to my Images.xcassets folder. I didn't want it so I tried to delete it and ended up deleting the whole file with the all references by accident. How do I fix it? I tried to do what was suggested in this post, but the file was empty with nothing in it. Does the file not show any thing?

Community
  • 1
  • 1
Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92
  • 4
    Is your code in source control? – Craig Otis Sep 03 '15 at 15:17
  • If you have not deleted the file from trash, then go to trash , left click on the assets and select the option Put Back, which will put the assets back in project folder. After that go to Xcode project, click left mouse button, select the option "Add Files to Project" and select the assets and it will work fine. – manish_kumar Sep 03 '15 at 15:23
  • It happened with me too, and I worked out this way. – manish_kumar Sep 03 '15 at 15:23
  • What is the source control? I found the json file in the trash, how do I get it in the image file I created? – Caleb Kleveter Sep 03 '15 at 15:23
  • The file is showing up in finder, but not in Xcode. – Caleb Kleveter Sep 03 '15 at 15:33
  • 1
    There are a few things you need to do to insure this (or worse) does not happen again: 1. Use Source control and commit often. Git is built into Xcode. When you create a project there is a check box to create a Git repository, it is checked by default. 2. Learn how to use Git in Xcode. 3. Backup your computer either by Time Machine (recommended and easy to setup) or another means such as Backblaze. 4. Use a remote Git repository, such as BitBucket which is free. Do it **today**, don't wait until the next loss. – zaph Sep 03 '15 at 15:34
  • At this point I think I will recreate the project, it wasn't that big. Thanks for the advice @zaph. – Caleb Kleveter Sep 03 '15 at 16:00

1 Answers1

0

What I did in the end because I had all the code and the app wasn't vary large is I made a new project and transferred everything. Then I created a git repository for if it happens again.

Caleb Kleveter
  • 11,170
  • 8
  • 62
  • 92