Import @mislav's git-overwritten script