-1

can you advice how I can revert to earlier good commit. Below is my commit code

git log --oneline
as4c704 (HEAD -> mybranch, origin/master, origin/HEAD, master) Merge branch 'branchA' of repo_name into master
e325c09 (origin/branchA) message
4549e4c Merge branch 'branchB' of repo_name into master
2f32d73 (origin/branchB) Merge remote-tracking branch 'origin/master' into branchB
221e689 Merge branch 'branchC' of repo name into master
f33c1c (origin/branchC) Merge remote-tracking branch 'origin/master' into branchC
6782c19 Merge branch 'branchD' of repo_name into master
1d3s525 Merge branch 'branchE' of repo_name into master
16438a DbranchE
112a682 message
dd3d883 BranchF message
5122492 BranchF message
bg3e17 message
33f71c message
346d27 message
... more

How can i keep commit 346d27, 33f71c and 221e689 and rest remove it from 33f71c onwards

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
navin
  • 55
  • 1
  • 6

1 Answers1

1

You have to issue the command git rebase -i 33f71c and edit each commit you want to remove entering the drop command.

Then save, exit, and issue the command git push --force.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74