Let me expand my comment to remove the question from unanswered.
Any point in $w\in\mathrm{T}M$ is a pair $w=(V,p)$ where $p\in M$ and $V\in\mathrm{T}_pM$.
Let $t\mapsto w(t)=(V(t),\gamma(t))$ be a curve in $\mathrm{T}M$.
Let $V=V(0)$ and $p=\gamma(0)$.
Note that
$$w'(0)=\nabla_{\gamma'(0)}V\oplus \gamma'(0)\in \mathrm{T}_{p}M\oplus\mathrm{T}_{p}M=\mathrm{T}_{(V,p)}\mathrm{T}M.$$
Therefore
$$
\begin{aligned}
\langle V\oplus 0,w'(0)\rangle
&=\langle V,\nabla_{\gamma'(0)}V\rangle=
\\
&=\tfrac12\cdot\langle V,V\rangle'(0).
\end{aligned}
$$
It follows that $(V,p)\mapsto V\oplus 0$ is the gradient of the function $f\colon(V,p)\mapsto \tfrac12\cdot\langle V,V\rangle$.
Whence the statement follows.