-2

I have a repository for Task-App

The main branch was with the Vite packges of the project I created first.

Then I decided to change all the project and recreate but with Nextjs packege instead, so I deleted all files in 'in my computer' and created a new one (reusing somethings from the old one).

At this point the old project was in GitHub and the new one in my computer.

So when I was going to commit, I selected the option to create a new branch (in the GitHub app) and all my new files was deleted and the old ones placed.

See the repository here: https://github.com/HigorR456/Task-App My VSCode is still opened and the new files I created in my computer was red with the letter D (meaning it were deleted).

How can I recover the files and delete these old ones?

I still didn't do anything, I just commited and published the new branch hoping to get the new files back but not. I expect to recover the files.

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Higor456
  • 19
  • 4
  • I don't see the problem. As far as I can tell, the stuff you're talking about is all sitting there in https://github.com/HigorR456/Task-App/compare/nextjs waiting for you. No? – matt Mar 27 '23 at 19:27
  • I want to recover the files that were in my computer, these files were deleted when I created a new branch (this files weren't ever commited), is there any option in vscode to restore it? I looked into the windows Trash and there isn't any file there, GitHub app just deleted all files I had changed in my computer when I created this new branch. – Higor456 Mar 27 '23 at 20:18
  • No, there's probably no way. I don't know why the files were deleted, but whatever wasn't commited is not something Git has any responsibility for (commit = save, that's all Git is about). So this would be about your computer backup if the vscode history doesn't have it. – matt Mar 27 '23 at 21:05

1 Answers1

-1

I managed to solve this problem, when I selected the option to create a new branch, GitHub created a clone from the latest commit (several days ago) and pushed all files into my computer, but the files I had edited and not commited yet were still there but in the main branch waiting for my response, whether I would like to restore or discard those changes. So when I selected the option restore, it replaced the old files and I got everything I had edited through those days back.

As you can see there is the main branch and the nextjs branch I had created, the nextjs branch is a clone from the old repository commited several days ago and the main branch was restored to the files I've been editing since them and I just commited to avoid losing everything

Higor456
  • 19
  • 4
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 01 '23 at 04:48