I'm trying to fix my git branches, here's what I did.
I had some code that should have been developed in a branch; however, I committed and pushed to master (commit A).
Then I went ahead and reverted that commit and also pushed the revert to master (commit B reverts A).
Then I created a branch off of commit A and continued my development (commit C and D). So this is what my tree looks like currently:
* D (HEAD -> branch_a, origin/branch_a) removed testing code
* C updated
| * B (origin/master, origin/HEAD, master) Revert "new code"
|/
* A new code
I want to be able to cleanly merge this branch back into master. Normally what I would do is git pull origin master
into my branch but I can't do that in this case because master
has the revert of A.
What can I do in branch_a
to make sure it will be able to merge back into master
without losing my work?