GitPython 라이브러리에서 로컬 변경 사항을 단일 파일로 되 돌리는 방법이 있습니까? 난 그냥 git checkout filename
를 사용하지만 GitPython의 API에서이 작업을 수행하려고 시도하는 것 망할 놈의 명령 줄에서GItPython을 사용하여 로컬 변경 사항을 파일로 되 돌리십시오.
, 그래서
repo.index.checkout([filename])
다음과 같은 오류에 이르게처럼
git.exc.CheckoutError: Some files could not be checked out from the index due to local modifications:['foo']