joe235

撤销修改

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

 

分类:

技术点:

相关文章:

  • 2021-12-22
  • 2021-11-30
  • 2022-01-05
  • 2021-11-01
  • 2021-12-13
猜你喜欢
  • 2021-08-15
  • 2021-08-15
  • 2021-09-06
  • 2021-07-06
  • 2021-04-28
  • 2021-11-15
  • 2021-04-22
相关资源
相似解决方案