Local and remote warehouse warehouse branch fall back to a specified history version (idea)

Content has been submitted to the repository (local and remote repository) using IDEA fall back to the original version specified

Revert operation: Revert operation will be submitted as a new record, which is appended to submit a log, so it retains the original submission record.

  On the version you want to roll back history, right-click

    

  If there is a conflict, double-click the file to view the conflict in the conflict, and resolve

    

   Back to back re-submit, you can simultaneously push to a remote repository

    

  This fallback advantage is that if the regret of the "back" this operation, you can not go back to a previous version rollback, because history also submit records retention,

  But the added file will not be submitted up rollback version is deleted, only modified files are rolled back, there is a conflict would be resolved manually.

Use of IDEA Reset Head pointer: Reset Head pointer, will abandon the original submission record, the Head pointer cast to the specified version.

  On the version you want to roll back history, right-click

    

    

    . 1, Soft
      ① HEAD pointer movement local library

      Meaning that, after the rollback, just move the pointer to the local library, while the staging area and your local code is not doing any change.

      And the last time you change the code has been submitted to the local library display is green, that is not submitted

    2, Mixed
      ① HEAD pointer movement local library

      ② reset the staging area

      Meaning that, after the rollback, not only to move the pointer to the local library, as well as the staging area things are gone, meaning that the last time you add a file to the temporary area did not

    . 3, Hard
      ① HEAD pointer movement local library

      ② reset the staging area

      ③ Reset Workspace

      Meaning that, after the rollback, the native code is your fallback version of the code

    4、keep

      ① mobile local library HEAD pointer

      ② Reset Workspace

      Meaning that, after the rollback, the native code is your fallback version of the code, the file is still saved in the temporary area.

  此时本地仓库回退了,但远程仓库还没有,push到远程仓库,会提示拒绝,但不能和远程仓库合并,因为合并就达不到回退的目的了

    打开Terminal,在本项目目录下,输入git push -f 强制同步远程仓库。

    

    同步后,会发现,git日志丢失了“第二次提交”以后的提交记录。

 

Guess you like

Origin www.cnblogs.com/roadlandscape/p/12359791.html