I was about to backup a new project remotely with git for the first time in a while.
Setup git, did an initial commit of the code, was about to push when I realised there was a resource file with data I'd rather not push. Went googling for how to undo the initial commit and stupidly just followed a post without fully understanding results (I know, but it's late, it's been a long day).
Did a git update-ref -d HEAD
followed by git reset --hard
.
I may have done a git add .
again afterwards, not sure.
Now ls and the IDE are showing everything as deleted.
git status
is showing Changes to be committed:
followed by what looks like all of my source, in green, with each item marked as new file
Below that is Changes not staged for commit:
along with all the files listed again,in red, marked as deleted
I'm hoping the source is still somewhere under git and there's a way of retrieving it? From the git status it looks like simply committing it will do it and I can push that? But I don't want to take any chances.
(in case it's relevant for other means of recovering the files, Ubuntu 18.04, data is on an ntfs formatted drive)