简体   繁体   中英

Recover deleted files after git push --force in github

accidentally I push code in GitHub by --force flag. After pushed the code, I got an url it looks like this,

compare/3b97dc6ae39ff9416863cbcdfa0a65dd315db7cd..b234e255fc5462a7c46e48ebf720b4f97f54480d?diff=split

now I want to revert back to 3b97dc6ae39ff9416863cbcdfa0a65dd315db7cd this commit. But I'm not able to move. I tried with this,

git reset --hard 3b97dc6ae39ff9416863cbcdfa0a65dd315db7cd

fatal: Could not parse object '3b97dc6ae39ff9416863cbcdfa0a65dd315db7cd'.

How could I revert back to this commit? Can anyone please help to do that? TIA

Try git fetch origin 3b97dc6ae39ff9416863cbcdfa0a65dd315db7cd before git reset .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM