Get Overwritten/Discarded Commits using reflog

git reflog

shows commits including the overwritten/discarded ones. This is useful in case of accidents such as unwanted git commit --amend and git reset.

Source

https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog

Extra

Use

git reflog --date=iso

to include dates.

Written on April 14, 2016 by joneriksuero