First of all, as Allen Knutson remarks, $X$ should have dimension at least two.
Now the Mehta-Ramanathan theorem tells you that if $\mathcal E$ is $H$-semistable and $D \in |mH|$ is general, with $m$ sufficiently large, then $\mathcal E \big|_D$ will likewise be $H\big|_D$-semistable.
But you are asking for the reverse direction. This is actually much easier. Namely, assume that $\mathcal E$ is not $H$-semistable, and let $\mathcal F \subset \mathcal E$ be a (saturated) destabilizing subsheaf. Then $\mathcal F\big|_D \subset \mathcal E\big|_D$ will still be destabilizing. Here you do not even need $m$ to be large (but $|mH|$ should be basepoint-free and $D$ should be general, to avoid problems when $\mathcal F$ is not locally free). On the other hand, if $D$ is not numerically equivalent to a multiple of $H$, the statement you are asking for definitely fails.