Remove commits belonging to later versions.