2

I treid to rebase my branch into another, but did something wrong which applied different patches to the same code, which resulted in alot of these:

<<<<<<< HEAD
<<<<<<< HEAD

All over my project.

Now when I try to undo all of these I did git reset --hard 44b76568 where 44b76568 is my latest commit before rebase. I got that my head was not at this commit, but nothing changed in my code. I still have

<<<<<<< HEAD

and other error codes, everywhere.

mrfr
  • 1,724
  • 2
  • 23
  • 44
  • You might post your *exact commands*, if you have them available (e.g., in bash history). – torek Aug 17 '17 at 14:23
  • 1
    tried `git checkout` to get your old version back? And, when there is conflict, git does not finish the rebase, I believe you could `git rebase --abort` – Leonardo Alves Machado Aug 17 '17 at 14:26
  • `git rebase --abort` only works if you are in the rebase process. How do I get my bash history? – mrfr Aug 17 '17 at 14:28
  • 2
    Perhaps the real problem here is that you've actually made a commit containing those conflict markers? If you have then no reset or checkout will get rid of them. Please check to ensure this isn't the case. – Lasse V. Karlsen Aug 17 '17 at 14:43

2 Answers2

1

If you know which commit is ok, you could go back to it using git checkout My_commit_ID . - in your case, It could be git checkout 44b76568 ., if you are sure 44b76568 is stable (or maybe a previous one, if it still has errors)...

Maybe this post will help you: How to rollback to an old git commit

FYI - To know the hash of your commits, use git log command (git log).

Leonardo Alves Machado
  • 2,747
  • 10
  • 38
  • 53
1
  1. Open up your repository in Git GUI if you have it installed.
  2. Go to Repository > Visualize [BRANCHNAME] history
  3. Right-click on the commit you want to reset to and select Reset... from the context menu.
  4. Select Hard to do a hard-reset. CAUTION: Local changes will be lost
  5. Redo all changes thereafter.
ashmaroli
  • 5,209
  • 2
  • 14
  • 25