Suppose I have a Git history that looks like (credit to this answer for the diagram, and see here for a clonable git repo with this structure):
A - B - D - F - G <- "master" branch (at G)
\ \ /
C - E --' <- "topic" branch (note: deleted!)
And suppose I've deleted topic
so that I no longer have it in my local or remote repositories (and the history has long since moved on, to the point where my reflog hasn't contained it for many months).
I'd like to find commit F, i.e., the newest commit in the master branch that does not contain any commits from the topic branch.
If it helps, I've located commit C, the commit where I started working on the topic branch.
Important: I can't do this by looking at the visual output of Git. In the real code I have, topic was merged into master tens or perhaps hundreds of times, and then master was subsequently developed (with many unrelated merges) thereafter. Therefore the proposed solutions for this question aren't usable for me.