Why is Q → P a logical consequence of ¬(P → Q )

Suppose $Q$.

Suppose $P$. We can conclude $Q$. Therefore, $P \to Q$. But we also know that $\neg (P \to Q)$. Contradiction. Everything follows from a contradiction; therefore, we can conclude $P$.

Thus, we have shown that $Q \to P$. $\square$

Phrasing the proof differently, we can show $\neg Q$ is a logical consequence of $\neg (P \to Q)$. Since $Q$ is false, $Q \to P$ is automatically true.