恢复仓库版本

git reset --hard +HEAD 或者+要回滚的版本号

 

git将单个文件恢复到历史版本的正确方法如下:
   git reset commit_id 版本号
   git checkout -- 文件路径