I'm still learning git and I'm using it for practice and as a tool to save my progress on my projects. I work from my office computer and from my home computer on the same application. I'm the only one working on it. Yesterday after I finished working from home I pushed my changes as always, but for some reason git complained (I must have done something wrong before). So I did (if I remember correctly) git push origin master --force.
Today at work I tried to update my local files and I got this message:
C:\Users\nova\Desktop\ez-class>git pull origin master
From https://github.com/sickdyd/ez-class
* branch master -> FETCH_HEAD
+ ace98f3...145956d master -> origin/master (forced update)
Already up to date.
But... it's not up to date. So I googled how to sort this out and a bit in a hurry I assumed this was the proper way: Git pull after forced update
So this is what I did (sigh):
C:\Users\nova\Desktop\ez-class>git fetch
C:\Users\nova\Desktop\ez-class>git reset origin/master --hard
HEAD is now at 145956d hello
C:\Users\nova\Desktop\ez-class>git pull
Already up to date.
C:\Users\nova\Desktop\ez-class>git pull origin master
From https://github.com/sickdyd/ez-class
* branch master -> FETCH_HEAD
Already up to date.
So I'm happy to let everybody know that apparently all my updates on the remote repository are gone as well as locally. I'm not sure what happened here... and is there any way I can fix this or I have to go home and push again the changes?
EDIT: finally I have to admit that git has been quite a pain in the ass just to keep files synced; do you know a better solution? Google drive won't allow to ignore subfolders (like node_modules).