I have a remote git repository on bitbucket (it's private, so I can't share a link here, I'm afraid)... I have a couple of branches there, two of them are:
- master
- cert_creation
Yesterday I was in the branch *cert_creation* and I've done a
git add --all
git commit -m "changes blabla"
git push origin cert_creation
...and everything looked fine. When I had a look into the latest commit on the Bitbucket Website, all changes seemed to be saved.
However, when I opened some files today on my local computer, I thought, that they weren't up-to-date.
So I wanted to revert all changes on my local machine to the latest remote commit (which I knew was correct). I googled for reverting a local git repository to the latest remote commit. I used these commands:
git reset HEAD --hard
git clean -fd
git fetch origin
git reset --hard origin/master
(and a couple of others which didn't work). The problem now is, that I've messed up everything even more. Now I have a really old git commit on my local machine (which is from the last time I merged cert_creation to master).
Now the question is how can I "revert the revert", i.e. update my local git repository to the last remote commit. Probably this was asked 100 times already somewhere on the internet, but I cannot find the correct keywords :[] And as I messed up something already I really want to be sure to do the correct thing.
Thank you very much for your answer in advance, I really appreciate your help!