You can create a commit that reverts to the base of the branch like this:
# on "topic" branch
git read-tree $(git merge-base topic master)
git commit -m "Reverted topic branch"
git checkout -- . # update working copy to match the committed tree
In your example use, you want to revert the changes so that you can merge the branch back into master
(or development
as it's called in your example) without actually incorporating any of the changes from the topic
branch. But that can be done without adding a revert commit by using the "ours" merge strategy. From the git-merge documentation:
ours
This resolves any number of heads, but the resulting tree of the merge is always that of the current branch head, effectively ignoring all changes from all other branches. It is meant to be used to supersede old development history of side branches. Note that this is different from the -Xours option to the recursive merge strategy.
For example:
git checkout master
git merge -s ours topic