Let's say for sake of example; I'm working on a static website which is generated using a template engine. The example stinks a little bit from a coding stand point (of course if you were generating menu's you'd want them to auto generate...but for sake of the example this is what has been presented in order to include more than one change that should be included in a single commit)
The website contains two sets of menus, and everytime a new page is added or removed we create a new branch in our repository for the new page.
Adding a new page to the site en-tales 3 changes to our commit:
Conversely to remove a page the same changes would be removed in reverse for the removal commit.
Now when a page has been added the branch will then be merged into the master branch.
Supposing that a branch has already been merged into the master but one of the three changes listed above has been left out of a commit; is it possible to go back and re-include the missing changes as part of the original branch / changeset, as long as nothing has been pushed to the remote? What is the cleanest way to do this?
Is this as simple as:
# Throw away the merge commit
$ git checkout master
$ git reset --hard HEAD^
# (assumes you haven't made more commits on master)
# fix up your branch
$ git checkout my-branch
# make your changes and commit
# re-merge into master
$ git checkout master
$ git merge my-branch
If you've made subsequent changes on your master branch it gets harder.