delete all the commits in a branch git code example Example: git clear commits git reset --hard origin