• IDEA git commit push revert


      

    1. Revert uncommitted changes

      You can always undo the changes you've done locally before you have committed them:

      1. Open the Version Control tool window (Alt+9) and switch to the Local Changes tab.
      2. In the active changelist, select one or more files that you want to revert, and select Revert from the context menu, or press Ctrl+Alt+Z. All changes done to the selected files since the last commit will be undone, and they will disappear from the Local Changes view.

      Undo the last commit

      IntelliJ IDEA allows you to undo the last commit in the current branch (i.e. HEAD):

      You cannot undo a commit if it was pushed to a protected branch, i.e. a branch to which push --force is not allowed. You can configure the list of protected branches in the Settings dialog (Ctrl+Alt+S) under Version Control | Git.

      1. Open the Version Control tool window (Alt+9) and switch to the Log tab.
      2. Select the last commit in the current branch and choose Undo Commit from the context menu.
      3. In the dialog that opens, select a changelist where the changes you are going to discard will be moved. You can either select an existing changelist from the Namedrop-down list, or specify the name of a new changelist (the commit message is used by default).
      4. Select the Set active option if you want to make the changelist with the changes you are about to discard the active changelist.
      5. Select the Track context option if you want IntelliJ IDEA to remember your context and reload currently opened files in the editor when this changelist becomes active.

      Revert a pushed commit

      If you notice an error in a specific commit that has already been pushed, you can revert that commit. This operation results in a new commit that reverses the effect of the commit you want to undo. Thus, project history is preserved, as the original commit remains intact.

      1. Locate the commit you want to revert in the Log view, right-click it and select Revert from the context menu. The Commit Changes dialog will open with an automatically generated commit message.
      2. If the selected commit contains several files, and you only need to revert some of them, deselect the files you do not want to touch.
      3. Click Commit to commit a changeset that reverts changes to the selected files in this particular commit

        信息来自:https://www.jetbrains.com/help/idea/using-git-integration.html#revert-local-changes
  • 相关阅读:
    排序
    FileOutputStream文件写入 —— 覆盖、追加
    判断一个地图坐标是否在中国镜内
    地图坐标转换
    全文检索 使用最新lucene3.0.3+最新盘古分词 pangu2.4 .net 实例
    blob转base64位 base64位转blob
    div中粘贴图片并上传服务器 div中拖拽图片文件并上传服务器
    DIV 粘贴插入文本或者其他元素后,移动光标到最新处
    project 计划添加编号或 任务分解时为任务添加编号
    修改project任务的默认开始时间
  • 原文地址:https://www.cnblogs.com/mengjianzhou/p/7662313.html
Copyright © 2020-2023  润新知