1

Guys I have the following scenario:

  1. I created a pull request with changes A,B,C (test-branch).
  2. I merged this branch to development (test-branch => development).
  3. I had to revert this merge;
  4. I merged new things from other branches;

Now I want to merge again these changes from (test-branch) but I can't, always the I give rebase or pull from test-brach the changes are not coming..

I already did reset hard origin/development locally but does not work.

someone can help ? I think I have to delete from tree, but I don't know

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
Jota
  • 819
  • 6
  • 24
  • 41
  • This is either a dup or pretty close to [this question](https://stackoverflow.com/q/68911641/184546). Either way, I believe the answer to that question will work for you. – TTT Jan 04 '22 at 04:39

1 Answers1

4

Now I want to merge again these changes from (test-branch) but I can't

That's correct. After a merge, you cannot merge the same commits again; they are already merged.

The fact that the merge commit was subsequently reverted makes no difference. The revert commit undoes the effects of the merge commit, yes; but the merge commit itself, along with the accompanying topology, is still there.

For a complete discussion along with possible options, see the canonical https://github.com/git/git/blob/master/Documentation/howto/revert-a-faulty-merge.txt.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Hii @matt, thanks for answering... you said: "After a merge, you cannot merge the same commits again; they are already merged.", even the changes cannot be merged again? I'm trying to pull changes directly from the commit of PR that I merged (before revert) but nothing happens. – Jota Dec 30 '21 at 13:21
  • "I'm trying to pull changes directly from the commit of PR that I merged" And that is _exactly_ what I've explained you cannot do. Please read my answer and the attached link. – matt Dec 30 '21 at 14:12
  • Also stop using the word "changes". Git is about _commits_, not "changes." – matt Dec 30 '21 at 14:14