It's not completely clear from your question, but I assume that what you want is to add a new commit whose source code is exactly the same as at the older commit, 6f374ed9
. (In other words, you want to avoid rewriting history, since obviously master
and task-e
have been pushed to GitHub.) This takes a few steps in git, which are described in this question. To summarize that, firstly make sure that you have no uncommitted changes (i.e. git status
is clean). You would then need to do:
# Switch to the branch you want to add the commit to:
git checkout master
# (... you can merge the result to the other branch later)
# Move the master branch back to the earlier, good commit, forcing the
# working tree and the index to match:
git reset --hard 6f374ed
# Use git reset --soft to point the master branch back to where it was
# originally, but leave the working tree and index as they were at 6f374ed
git reset --soft HEAD@{1}
# Commit the result:
git commit -m "Reverting state back to 6f374ed9"
Then, to update task-e
as well, you can do:
git checkout task-e
git merge master