how to remove a commit from local branch in git code example Example: delete everythng after a certain commit git reset HEAD@{index}