I've read all the answers for this specific question and i know it might look as duplicate, but i don't think it is, i think that i'm asked to do something deferent and maybe i don't understand the answers and i'm not that strong in git. (using mostly source tree)
The problem is:
I have a project that i got while it was developed and it didn't go anywhere do i got a task to fix it. now that it fixed and i've pushed like 30 times over the old commits of the previous developers my boss want me to remove a specific commit from the log (history) that he doesn't want to client to see (fully remove the commit form the log.
The issue is that my code was based on the code on the old commits, i didn't have time to start the project form scratch so i fixed the old code and went form there and i'm afraid that i dod a rebase i will delete something.
To be clear (i can't post the git history, sorry, but hope that someone could help). I have old pushed commits that i need to keep in the history, then in the middle I have two pushed commits that i need to remove fully from the log and history but keep the code that was pushed in them and then i have more pushed commits that i need to keep in the history.
Thanks for the help and sorry i didn't have any example to put here.
If your history from the old to the current commits is linear, a simple interactive rebase and then force push would be possible. In the interactive rebase, you can squash the "bad" commits into the commits before or after, so the changes will still be there, but look like they were part of other commits.
Note you can "backup" the current state under some branch name, and after rebasing you can compare, and if you do not like the result, you can always reset hard to your backup commit.