0

We are working on a repository with a fellow programmer which he commits to a separate branch and I on the master.
A few days ago he decided to merge master into his branch but after merging faced some environmental dependency issues and decided to revert that merge. All was well and we kept committing on.

Now that I need to merge his branch into master I'm having difficulties with the revert commit since it's deleting some of the files which I have not changed since that merge.

I think this can be addressed by deleting the said merge and it's revert from the history.

Now the question is how to remove a few commits far back in history?

2hamed
  • 8,719
  • 13
  • 69
  • 112
  • If he didn't do to many commits, you could `rebase` his branch on top of `master`. You could `rebase --interactive` then skip unwanted commits. – Flows Sep 07 '16 at 12:20

1 Answers1

1

couple of strategies, try to play with

 git log

and then

 git reset --soft/--hard HEAD@{NUMER}

where soft or hard are reset type and number is where you want to go. You can use any GUI like sourcetree and cherrypic specific commit and create a new branch.

Note: make sure that you play in a separate branch or have backup.

iSensical
  • 747
  • 5
  • 8