git 提交的撤销和恢复
查看某次提交旧版本里的内容
git show <commit-id>:path/to/file
从之前的某次提交中恢复某个文件
git restore --source <commit-id> -- path/to/filegit checkout <commit-id> -- path/to/file
撤销上次提交里的某个文件的修改
git restore --source=HEAD~1 --path/to/file
撤销很久之前某次提交对某个文件的修改
git diff <commit-id>^ <commit-id> -- path/to/file | git apply -R

浙公网安备 33010602011771号