Git Revert Head Command Python