Suppose I have commits A-B-C-D-E-F. Note that all the commits have been pushed upstream.
I want to revert to commit D, but also want to keep commits E and F in the branch.
So what I want to do is to create a commit G, which will have the same contents as D. In the end my branch will look like A-B-C-D-E-F-G, with D=G.
How do I do this?