So, I had a repo that I had always updated only from my local machine by using the following script.
#!/bin/bash
cd /usr/share/hassio/homeassistant
source /srv/homeassistant/bin/activate
hass --script check_config
git add .
git status
echo -n "Enter the Description for the Change: " [Minor Update]
read CHANGE_MSG
git commit -m "${CHANGE_MSG}"
git push -f origin master
exit
In between running that script, I decided to finally create a long and detailed README.md for my repo using the online editor like in this screenshot where I just edited the file and only pressed the green button to commit the change.
However, when I ran the aforementioned script again the next time, the README.md is gone and there is no trace of any of those commits ever existing. If I run a git reflog I see 9e63827 which is the most recent time I ran the shell script, and 54b6047 which is the previous time I ran the shell script, but I don't see any of the 100 commits I made online to the README.md in between.
root@narnia:~/hassio/homeassistant# git reflog
9e63827 (HEAD -> master, origin/master) HEAD@{0}: commit: Finally finished moving to new iOS app on all devices, cleaned up old trackers, speedtest to automation so I can turn it off, withings integration
54b6047 HEAD@{1}: commit: Fixed Zwave Battery Sensors and Warnings, first stab at appliances tab
2a5768f HEAD@{2}: commit: Heating Python Script, Heating window automations, fixed popup lovelace
When I run git fsck --lost-found I get 3 dangling blobs
Checking object directories: 100% (256/256), done.
dangling blob d370200927d6739d8156f8e2672cd4889f558547
dangling blob f7a1c6af989d3f41117f209f9a524821691c116d
dangling blob c61265cf4e353d0a474e29b33ed066be632164fd
None of which contain any trace of my README.md when I check them with a command like git show f7a1c6af989d3f41117f209f9a524821691c116d
I can't believe all those hours of work on my README are really gone are they? What the heck happened and how do I get them back?