You "distributed" the negation inside the parenthesis. Let's focus on the [tex] \lnot (p\wedge \lnot q) [/tex] part.
We can distribute the negation inside the parenthesis by negating every term, and switching and with or, and vice versa. So, you have
[tex] \lnot (p\wedge \lnot q) \equiv (\lnot p) (\lnot \wedge) (\lnot \lnot q) [/tex]
Of course, writing [tex] \lnot \wedge [/tex] is improper, I was just stressing the fact that we distributed the negation to every term in the parenthesis. So, since a double negation cancels out, you're left with
[tex] \lnot (p\wedge \lnot q) \equiv \lnot p \lor q [/tex]
which of course implies that
[tex] \lnot (p\wedge \lnot q) \lor q \equiv (\lnot p \lor q) \lor q [/tex]
Edit: I actually derived the expression in the opposite order, but since they are equivalent, it doesn't really matters where you start from and where you get to. Anyway, if you actually want to derive [tex] \lnot (p \wedge \lnot q) \lor r [/tex] from [tex] (\lnot p \lor q) [/tex], you simply have to negate the first parenthesis and distribute the negation as discussed.