It depends on how soon after your miscarriage you take the test
Pregnancy hormones drop quickly after a miscarriage but they are still in your system. This is especially true if you were farther along in your pregnancy before the loss. I would wait at least a month after a miscarriage before taking a test. If that test comes up positive I'd see your doctor right away to check everything out.