Accidentally run the ggt in the wrong repo and now its deleted the files

Not quite sure the best way to get back to what I had before I did this - any recommendations?
23 Replies
AlexFPV
AlexFPVOP7mo ago
It deleted virtually all my files...
Unknown User
Unknown User7mo ago
Message Not Public
Sign In & Join Server To View
AlexFPV
AlexFPVOP7mo ago
So its deleted the gadget apps files - not the repo that I ran it in Perhaps theres a way to restore it from an older backup - but at the moment I can't open in gadget as the files aren't there and thus have errors: - "api/" is not found. It must be a root level folder - "settings.gadget.ts" is not found - "accessControl/permissions.gadget.ts" is not found - "session" model must exist
Chocci_Milk
Chocci_Milk7mo ago
Hello, You will need to pull the last files from your git repository
AlexFPV
AlexFPVOP7mo ago
As in the gadget files that were added to my repo that I mistakenly ran ggt in? - unfortunately I dismissed the commit to that repo... Is that the only way? Would it be possible to backup from a previous verison?
Chocci_Milk
Chocci_Milk7mo ago
We retrieve files for our users as a last resort. You should start from your last commit that has the needed files in it
AlexFPV
AlexFPVOP7mo ago
How would you do that if you don't mind me asking? I went to sync.json and changed the files version but I am guessing that's not the right way to go about it I think we might have to retrieve on your side if possible, I can't seem to get it back... I didn't link with a github repo - I just had it locally...
Chocci_Milk
Chocci_Milk7mo ago
If you have a git repository please first bring back a previous commit
AlexFPV
AlexFPVOP7mo ago
I don’t I am afraid… I have the folder in my local environment and was using ggt. However I also had my shopify store GitHub repo open in another cursor window and mistakenly ran the ggt command there which is where the files got deleted. I discarded the changes in the commit on that repo…
Chocci_Milk
Chocci_Milk7mo ago
Could you please share the URL of your app and I can get the files to you ASAP
AlexFPV
AlexFPVOP7mo ago
https://wholesalers.gadget.app Thanks man - appreciate it! I did some things to get it to work again but it didn't work. Will just be the commit before all the files got deleted 😭
Chocci_Milk
Chocci_Milk7mo ago
Your files have been sent to you privately
AlexFPV
AlexFPVOP7mo ago
What would be the best way to restore to this version?
Chocci_Milk
Chocci_Milk7mo ago
You should unpack the files locally and push them to the environment
AlexFPV
AlexFPVOP7mo ago
I see, I think the zip you gave me didn't include the files that I lost - at least the important ones. The routes and utils from memory...
Chocci_Milk
Chocci_Milk7mo ago
I only chose a version from 2 versions prior. Let me give you one from earlier
AlexFPV
AlexFPVOP7mo ago
Ahh strange - there should be a few files in the routes : POST-wholesaler-submission.js, GET-wholesalers-[customerId].ts for example
Chocci_Milk
Chocci_Milk7mo ago
Do you have anything in your .gadget folder backup? Not the files I gave you but the files that were already in your local
AlexFPV
AlexFPVOP6mo ago
Unfortunately not... also I can't access the gadget app ui as a lot of the main files were deleted so we get an error saying we need to fix the issue we introduced locally. I do have some of the files in the trash by the looks of it. Sorry to come back to this so late! I sort of left it because it was to much to deal with at the time 😅 Is it possible to get the files in the version that had the routes in them and web files also - the files you gave me before didn't actually hold any of the files - seemed like a blank project. All the files were saved to gadget before I messed everything up so they must be there somewhere 🤞
Chocci_Milk
Chocci_Milk6mo ago
It's a very long process to go and find the correct files. I don't really have the bandwidth to do so. This is not something that we typically do for our customers
AlexFPV
AlexFPVOP6mo ago
I understand - apologies! I think I'll have to start again with it by the looks of it - my own fault
Chocci_Milk
Chocci_Milk6mo ago
I would highly recommend immediately using git so that you can revert branches or commits if you make mistakes
AlexFPV
AlexFPVOP6mo ago
Yes haha I learnt the hard way! Will be doing so with all my projects now

Did you find this page helpful?