A shale gas reservoir is usually hydraulically fractured to enhance its gas production. When the injection of water-based fracturing fluid is stopped, a two-phase flowback is observed at the wellbore of the shale gas reservoir. So far, how this water production affects the long-term gas recovery of this fractured shale gas reservoir has not been clear. In this paper, a two-phase flowback model is developed with multiscale diffusion mechanisms. First, a fractured gas reservoir is divided into three zones: naturally fractured zone or matrix (zone 1), stimulated reservoir volume (SRV) or fractured zone (zone 2), and hydraulic fractures (zone 3). Second, a dual-porosity model is applied to zones 1 and 2, and the macroscale two-phase flow flowback is formulated in the fracture network in zones 2 and 3. Third, the gas exchange between fractures (fracture network) and matrix in zones 1 and 2 is described by a diffusion process. The interactions between microscale gas diffusion in matrix and macroscale flow in fracture network are incorporated in zones 1 and 2. This model is validated by two sets of field data. Finally, parametric study is conducted to explore key parameters which affect the short-term and long-term gas productions. It is found that the two-phase flowback and the flow consistency between matrix and fracture network have significant influences on cumulative gas production. The multiscale diffusion mechanisms in different zones should be carefully considered in the flowback model.