Accidentaly deleted files #78030
Replies: 2 comments 3 replies
-
Thanks for posting in the GitHub Community, @freeelancer86 ! We're happy you're here. You are more likely to get a useful response if you are posting your question in the applicable category, the Projects and Issues category is solely related to conversations around the GitHub products Issues and Projects. I've gone ahead and moved it for you. Good luck! |
Beta Was this translation helpful? Give feedback.
-
The problem is that you still have the commit with large files in your branch even if you use git revert (or delete the files and commit). Therefore, when you try to push, it will still try to upload the large files. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Feature Area
Issues
Body
I'm having a very similar issue that's described in this thread:
atom/github#1001
In my case I was using git desktop to upload my project folder on Git. My internet was acting up and after several tries that failed to upload, I removed a bunch of files from the folder in order to reduce the workload and try to do it piecemeal. I thought the commit would automatically update the files, so I tried to upload the 4th time, but saw the number of files still being as original. I used "Revert changes in commit" and now all of my files are stuck in the limbo.
Things I've tried to correct my mistake:
**git fsck --lost-found **
Checking object directories: 100% (256/256), done.
Checking objects: 100% (5742/5742), done.
Verifying commits in commit graph: 100% (1/1), done.
So, the files are thankfully still there. However, I don't see lost-found folder in my project. Next I tried:
for blob in $(git fsck --lost-found | awk ‘$2 == "blob" { print $3 }’); do git cat-file -p $blob > $blob.txt; done
This returns following message: blob was unexpected at this time.
git reflog
07b80f9 (HEAD -> main) HEAD@{0}: revert: Revert "initial commit"
4aa11f7 HEAD@{1}: commit: try 2 of initial commit
bce43ae HEAD@{2}: commit (initial): initial commit
That's it. What do I do now?
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions