Pregnancy After Miscarriage

I technically found out I was pregnant 08/06/20 , with a faint positive . I just didn’t believe it because I had what I thought was spotting . Over the next few days I took more test and got faint positive after faint positive . Went to a “walk in clinic here” on 08/08/20 and the test they did was negative BUT I was like how ... bought the digital kind and it read pregnant ! And got more and one did ! Woke up with more so bleeding on 08/09/20 went to ER and blood and urine test were both negative 😭😭 spontaneous miscarriage was what I was told and I was confused just as to how over less than 15 hrs I went from pregnant to not !? I cried so hard and I took my last digital and read not pregnant ! But my question is how soon after a miscarriage can you or did you get pregnant ?