I'm getting a little confused with git branch management and could use a little help. I know there are several question on SO that are related, but I'm not sure if this situation is entirely the same and I don't want to mess things up.
We have a branch called 'master' that is meant to be a representation of what is currently in production. We have another branch called 'development' that represents what is on our test server and contains any current development/bug fixes that are ready for testing. When working on user stories or bug fixes, our developers are supposed to create a branch for each story/fix. When it is ready for testing, it is merged into development branch and the test server is updated. When story/fix is moved to production, it is merged into the master branch.
One of our developers recently pushed 8 changes directly into the master branch. These changes have since been merged from master into the development branch.
What I need to know is:
- How do I remove those commits from the master branch so master remains an image of what is actually in production. I've seen a number of SO posts advocating rebase or cherry-pick but I am uncertain if they apply and would appreciate specific advice for my situation.
- Is it safe to do this given the merge to development branch, i.e. will removing them from the master, however that is done, also remove them from the development branch? I'm confused because I see that after the merge they retain the same id and parent so I'm uncertain what effect deleting them from master will have, if any.
EDIT: I should also mention that I've seen this post which may be what I need, but again would appreciate confirmation and I'm still unsure how this would affect the merge to the development branch.
FYI, I'm using tortoisegit (but don't have to).
Thanks for any advice.