What is `reflog expire` and how do `gc.reflogExpire` and `gc.pruneExpire` interact?
AdvancedConceptUndoing changes: reset, revert, restore and reflog
Answer
Reachable reflog entries expire after 90 days and unreachable ones after 30 (gc.reflogExpire, gc.reflogExpireUnreachable). Objects only become prunable when not reachable from refs or reflog and older than gc.pruneExpire (2 weeks). So a lost commit is typically recoverable for at least a month, but never rely on it for shared data.
More on Undoing changes: reset, revert, restore and reflog
What are the three modes of `git reset`?BeginnerWhat is the difference between `git reset` and `git revert`?BeginnerHow do you discard changes in one file?BeginnerHow do you recover a commit after `git reset --hard`?IntermediateCan you recover uncommitted changes lost by `git reset --hard` or `git checkout .`?IntermediateWhat does `git commit --amend` do to the reflog and to the old commit?Intermediate