Always flush your membranes with RO permeate until the pH measured at the waste end is within a pH range of 5 – 9.  You can then proceed to flush with feed water until the pH of the water exiting the RO membrane system is similar to the pH of the water that is entering the RO membrane system.  Conductivity of the water exiting the RO membrane system should also be similar to the conductivity of the water entering the RO membrane system.  No foaming from the RO cleaning chemical should be detectable.  Once these three conditions are met, it is presumed that residual RO cleaning chemical has been mostly (if not completely) flushed from the membrane surface, and the RO system can be placed back in operation.