If you are sure that your Ghusl of Janabah was invalid e.g. you did not make the water reach to every part of your body, ultimately the Ghusl is invalid ven if you did not know that it was invalid.
In such case you need to re-do all the obligatory worship like Salaah, fasting etc which you performed without a valid Ghusl.
The reward for your previous deeds will
never be wasted by Allah SWT, but you must re-do it as it has been
done without valid Ghusl. You can perform the Qadha gradually or with your daily prayers.