Point branch to new commit
Necromancy, I know.
git branch -f master C
Will not touch current working tree at all - you can have your work in progress.
Solution
git checkout master
git merge C
With C
being the SHA1 of commit C
.
Result
D (dev)
/
master A - B - C (move master HEAD)
It should be a fast-forward merge.