C
C#4mo ago
dany3xp

recover deleted files from github on visual studio

please private message me asap. thank you.
12 Replies
Jimmacle
Jimmacle4mo ago
we don't do help through DMs here, and you need to explain your problem more clearly do you actually mean github or do you mean git? what did you do to cause the files to be deleted?
dany3xp
dany3xpOP4mo ago
okay and I think git on visual studio. I went on Local History section, right clicked it and Reset -> Delete Changes.
Jimmacle
Jimmacle4mo ago
if they aren't in your recycle bin then they're gone the button does what it says, it deletes any changes since the last commit i don't know whether that particular button does git reset --hard HEAD or git clean -f, the first will only revert tracked files but the second will delete anything that isn't already in git
dany3xp
dany3xpOP4mo ago
i dont know but this is bad then all my scripts are gone
Jimmacle
Jimmacle4mo ago
what were you trying to do by deleting changes?
dany3xp
dany3xpOP4mo ago
I thought I didn't connect the scripts correctly to the repo because I kept getting errors so I was just trying to delete it and make a new one
Jimmacle
Jimmacle4mo ago
i mean, mission accomplished?
dany3xp
dany3xpOP4mo ago
uh
Jimmacle
Jimmacle4mo ago
sucks that you learned the hard way but always make backups before doing something potentially destructive
dany3xp
dany3xpOP4mo ago
UPDATE: I was able to find all of my deleted files using Git Bash! I ran the command git fsck --lost-found within the repo directory. It showed all of my deleted files with a prefix dangling blob followed by a hash number. Then the command git show <hash number> showed the contents of the file. It took a while but I was able to locate all of my code.
Jimmacle
Jimmacle4mo ago
interesting, looks like that can work if you staged the files but didn't commit them you learn something new every day $close
MODiX
MODiX4mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Want results from more Discord servers?
Add your server