將檔案還原到以前的版本

要將檔案還原到以前的版本,你可以使用 reset。

git reset <sha1-of-commit> <file-name>

如果你已對檔案進行了本地更改(你不需要!),你還可以使用 --hard 選項