撤銷修改
1.先查看該Git倉庫的當前狀態:
git status
顯示:
On branch master Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: a.txt
2.現在想撤銷對a.txt文件的修改,可執行如下命令:
git checkout HEAD a.txt
如果是帶目錄的:
git checkout HEAD config/index.js
提交單個文件:
git add 文件名 // 比如 git add src/goods.vue
多個文件的話,可以多次git add 文件名。
然后提交:
git commit
git push