will the commit that I overwrote exist somewhere?
Only in:
- the reflog of your local repo
- the reflog of your remote upstream repo (where that commit were previously published).
That upstream repo is usually a bare one, as kostix comments, socore.logAllRefUpdates
needs to be true, if you want to see the reflog in said bare upstream repo. - any other other local clone of your remote repo, done before your second git push (
--force
) by other people.
Note that ORIG_HEAD
(a memento from a time where reflog didn't existed yet) is not created/updated by a git commit
(like a git commit --amend
or a git commit --amend -m "new comment"
).
So if the reflog
isn't activated on a repo, ORIG_HEAD cannot be used to reference the amended commit.