git clear local commit with out deleting code example Example: remove the commit from local git reset --soft HEAD~1