I think your best bet at this point is the loggies. If you just redirected, the first line of the HEAD reflog will look like this:
63e21fb HEAD@ {0}: merge origin/master: Fast-forward
Thus, you should be able to print only the first line ( git reflog -n 1 ), check if it matches merge .*: Fast-forward$ , and if so, do git diff HEAD@ {1} HEAD . (You want to look at the locks to see if a quick merge is possible if you cannot be sure of your script that this is the only option now.)
source share