recover deleted files from github on visual studio
please private message me asap. thank you.
12 Replies
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?
okay and I think git on visual studio.
I went on Local History section, right clicked it and Reset -> Delete Changes.
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 giti dont know but this is bad then all my scripts are gone
what were you trying to do by deleting changes?
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
i mean, mission accomplished?
uh
sucks that you learned the hard way but always make backups before doing something potentially destructive
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.interesting, looks like that can work if you staged the files but didn't commit them
you learn something new every day
$close
If you have no further questions, please use /close to mark the forum thread as answered