delete local commit in git with id code example Example: delete everythng after a certain commit git reset HEAD@{index}