zoukankan      html  css  js  c++  java
  • [Git] Undo my last commit and split it into two separate ones

    When you accidentally committed some changes to your branch you have various possibilities to “undo” that operation and add some more changes. One is to use git amend to change the commit message or add new files. But what we want to take out all of the committed changes again and maybe even split them into separate commits. Let’s see how we can achieve that. Note: This only holds if you did not yet push your changes to the remote repository.

    In this case, what we can do is first do the reset:

    git reset HEAD~

    Then spreate files into diifferent commit messages.

  • 相关阅读:
    vue 开发系列 企业微信整合
    MongoDB基础3
    MongoDB基础2
    MongoDB基础1
    SpringBoot MongoDB
    UWSGI
    Nginx
    编译python源码
    Flask部署
    Django个人工作总结
  • 原文地址:https://www.cnblogs.com/Answer1215/p/10603398.html
Copyright © 2011-2022 走看看