Git: Accessing lost commits
Every time you amend
, rebase
or reset
, git commits get "overwritten".
However, git still allows you to checkout those commits using their SHA1, given you can find it.
One option to do this is
git reflog
# or
git reflog show [BRANCH]
This will show a list of all commits the branch has recently pointed to.
Git might garbage collect those commits eventually, but this should only happen after several weeks.