I found a derivation for the formula of logistic regression, it uses the hypothesis concept stated like:

and the derivation that I have doubts is:

For example, in the horizontal line that I marked, why the sign is changed to minus?; and the part that I marked with the diagonal line, where does it come from? From what I see it applies the derivative of ln and the derivative of the product, but I have doubts on the parts that I show.
Any help?
PD. In the derivation part the author is using only one sample, that is why the value of m=1 and the summation disappears.
For your first question, an additional minus sign appears when we differentiate $\log(1-h(x))$: $${\partial\over\partial\theta_j}\log(1-h(x)) = \frac1{1-h(x)}{\partial\over\partial\theta_j}(1-h(x))=\frac1{1-h(x)}(-1){\partial\over\partial\theta_j}h(x)$$ and this minus sign is moved into the large parenthesized expression. Note that there is no minus sign when we differentiate $\log h(x)$.
For your second question, write $u:=\theta^Tx$. Then $g(u)=\frac1{1+e^{-u}}$ and $${\partial g\over\partial\theta_j}=g'(u){\partial u\over\partial\theta_j}\;.$$ Then check that $$ g'(u)=(1+e^{-u})^{-2}e^{-u}=\frac1{1+e^{-u}}{e^{-u}\over1+e^{-u}}=g(u)(1-g(u))\;. $$