在git push的时候,有时候我们会想办法撤销git commit的内容
1、找到之前提交的git commit的id
git log
找到想要撤销的id
2、git reset –hard id
完成撤销,同时将代码恢复到前一commit_id 对应的版本
3、git reset id
完成Commit命令的撤销,但是不对代码修改进行撤销,可以直接通过git commit 重新提交对本地代码的修改

 

 

==================================

 

1.

打开git bash控制终端后依次输入以下命令:

 

  • cd ~
  • vi .gitconfig    

打开文档后按下i键 在文件中加上如下

[credential] 
  helper = store --file .git-credentials 

 

按下ESc键,输入:wq保存退出,再回到项目所在目录,push时再输入一次,以后就不用输入了。

 

https://blog.csdn.net/weixin_38450840/article/details/80831414

 

 

2.git rm --cached

 

git rm --cached -r TextProject/inweb01/build

http://www.cnblogs.com/lixiuran/p/5597759.html

 

3.

 

git stash list

git stash clear 

 

https://blog.csdn.net/csdnmuyi/article/details/80237173

相关文章:

  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2022-01-07
  • 2021-08-07
猜你喜欢
  • 2021-10-09
  • 2022-03-08
  • 2021-05-31
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
相关资源
相似解决方案