1、git restore --staged <文件>
清除暫緩區文件名
2、git reset --hard?<版本號>
回滾到上一版本
如看PHPstrom如何操作請參考https://blog.csdn.net/qq_35774849/article/details/107312658
3、解決沖突
(1)使用默認的解決沖突
打開文件進行刪刪刪
(2)使用vimdiff進行解決沖突
安裝
git config merge.tool vimdiff
git config merge.conflictstyle diff3
git config mergetool.prompt false
檢測合并沖突
git mergetool
檢測與上個版本的不同
git difftool
(3)使用可視化工具(mac為例)