git restore
從stage恢復工作區
git restore -W xxfile
git restore --worktree xxfile
從本地倉庫恢復暫存區index
git restore -S xxfile
git restore --stage xxfile
從本地倉庫恢復工作區和index
git restore -W -S xxfile
git restore -W -S commitid xxfile
從stage恢復工作區
git restore -W xxfile
git restore --worktree xxfile
從本地倉庫恢復暫存區index
git restore -S xxfile
git restore --stage xxfile
從本地倉庫恢復工作區和index
git restore -W -S xxfile
git restore -W -S commitid xxfile