Files Missing after Creating Branch

Hi,

I tried to make a new branch of my project and upon doing so, all of my old files disappeared. They are no longer in my folder directory or available in Xcode. Please let me know if there is any way to recover these files. I don't see the files in my trash either.

In Xcode, press command-2 and then click Repositories in the window on the left. What branch(es) do you see?

Thank you for your response. Both branches are completely empty aside from the auto-generated code that new projects have.

What happens if you switch to main? (Right click on it and choose switch... )

Also, if you click on the folder at the left above the word "Changes", do you see files?

Regardless of whether I'm in main or the new branch, the only files are the template files that are generated when creating a new project.

There are two files under "Changes": (Project Name)-Info and build.

What if you click the circled folder?

The only files displayed with both branches are below:

When you worked on your first branch, did you commit your work before creating and switching to a new branch?

You could take a look at the .git directory inside your project root directory if there is anything in there but if you did not commit there is a good chance you lost your work.

What files are missing? It looks like you have the beginnings of a project there. Certainly more than the boilerplate that you get when you create a new project.

I don't even see a .git folder in the root directory. I had at least 20-30 files. I don't quite remember all of the steps I took. What I remember is I added a file to one of the branches, and went to switch to see if it only added the file in one of the branches. After that, both ended up empty. I have a revision on my phone and simulator. Is there any way to recover the files with that?

It won't show up in the project or the Finder. Try using Terminal:

cd /path/to/project/.git

ls

Thanks for your response. Below is what comes up both from cd ./git both the in the project folder.

Hi,

Just following up to see if anyone has any idea how to resolve this. Thank you.

Files Missing after Creating Branch
 
 
Q