Git reset current rebase

I am doing a rebase. I worked on resolving some conflicts, but I ended up in the wrong direction, and now I just want to start fixing these conflicts.

I would like to reset reinstall, so I'm still reloading the current commit, but the working copy was reset when a conflict was noted at the time of commit.

How can I reset restore the current commit?

+4
source share
3 answers

If you just want to repeat the merge for a specific file, all you have to do is:

git checkout -m <file>

If you want to redo all commit, here is how I do it (perhaps the best way to do this):

  • There is a conflict during rebase
  • I messed up the resolution of the conflict.
  • git status, Git 2.0.0 - (, rebase):

    interactive rebase in progress; onto 14ed389
    Last command done (1 command done):
       pick db2511c Modify file
    Next command to do (1 remaining command):
       pick d1c2037 Modify file one more time
      (use "git rebase --edit-todo" to view and edit)
    You are currently rebasing branch 'other' on '14ed389'.
      (fix conflicts and then run "git rebase --continue")
      (use "git rebase --skip" to skip this patch)
      (use "git rebase --abort" to check out the original branch)
    
    Unmerged paths:
      (use "git reset HEAD <file>..." to unstage)
      (use "git add <file>..." to mark resolution)
    
            both modified:   file.txt
    
  • , rebase: pick db2511c Modify file
  • git rebase --edit-todo
  • git rebase --skip
+3

,

git rebase --abort
+2

, , , - , (git rebase --abort), , .git/rebase-apply patch. , . git rebase --abort.

0

Source: https://habr.com/ru/post/1627116/


All Articles