php - After git commits forcefully, can the files in the remote warehouse be retrieved?
phpcn_u15822017-07-01 09:12:05
0
2
914
The remote warehouse is completely inconsistent with the local warehouse. I accidentally forced a submission. git push origin master -f was completely overwritten. Can I still roll back now?
After executing
git reset
, the contents in the .git/objects folder are not deleted accordingly.Run
git reflog
to find the previous commit ID (commit_id)Then
git reset --hard commit_id
Yes,
git reset --hard HEAD~1