美文网首页
Local changes were not restore

Local changes were not restore

作者: else05 | 来源:发表于2017-06-15 09:31 被阅读335次

    下班的时候准备提交(git)代码走人 , 先更新到本地,然后再提交,这是平常一直使用的步骤。结果执行更新后,没有提示合并,把代码给我回退了到以前的版本了,在intellij 右下角提示了 Local changes were not restored

    Local changes were not restored
    Before update your uncommitted changes were saved to stash.
    Update is not complete, you have unresolved merges in your working tree
    Resolve conflicts, complete update and restore changes manually.
    
    image.png
    • 意思是:代码和服务器上的有冲突,合并失败了。未提交的更改被暂时保存到了stash (git的暂存区),要手动处理合并。

    1 . 命令操作

    # 查看存档列表,根据列表时间大概可以找出要恢复的东西
    git stash list 
    # 使用指定存档 , 存档编号就是上个命令中看到类似`stash@{0}`
    git stash apply stash@{存档编号}
    
    image.png

    2 . Intellij 操作

    image.png image.png

    参考:

    相关文章

      网友评论

          本文标题:Local changes were not restore

          本文链接:https://www.haomeiwen.com/subject/iqryqxtx.html