Git - Can we recover deleted commits? [duplicate]
问题 This question already has answers here : How can I recover a lost commit in Git? (3 answers) Closed 3 years ago . I am surprised, I couldn't find the answer to this on SO. Can we recover/restore deleted commits in git? For example, this is what I did: # Remove the last commit from my local branch $ git reset --hard HEAD~1 # Force push the delete $ git push --force Now, is there a way to get back the commit which was deleted? Does git record(log) the delete internally? 回答1: To get back to that