I created a new folder in my system. There, I did git init
and then added remote origin like
git remote add origin https://github.com/usrname/reponame
Then, without taking pull, I forcefully pushed my local change to existing git repo using -f
command which deleted previous data and stored new one.
Now I want my previous data of that git repo. Just after git push
, I executed git reset --hard HEAD~1
, but got this error:
I also tried git reset --hard last_commit_id
, which I got after forced update but getting error like fatal: ambiguous argument '0...4': unknown revision or path not in the working tree
.
I even did git log --all
or git reflog
, but not getting previous commit IDs and data.