git其他操作

Git恢复之前版本的两种方法reset、revert(图文详解)

https://blog.csdn.net/yxlshk/article/details/79944535

 

git命令行下回退一个文件到上一个版本

https://blog.csdn.net/feinifi/article/details/85867008

IntelliJ IDEA下git版本回退,版本还原

https://blog.csdn.net/hehyyoulan/article/details/80005272

 

---------------------------------------------------------------------

回退之后,遇到其他问题,如再次提交文件灰遇到 head 的deatched的错误,提交不了

HEAD detached from e06ccf8 Changes not staged for commit:   (use "git add <file>..." to update what will be committed)   (use "git checkout -- <file>..." to discard changes in working directory)          modified:   pom.xml  no changes added to commit (us

 

git status 可以看到是这个错误。

HEAD detached from e06ccf8
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

2020年2月16日

解决方案:

git checkout master

git commit -am 'modify'

git checkout master

根据提示,找到66eb3dc之类的id

git branch servicebranch 66eb3dc

成功。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值