Can anybody help me?

Gi
I took a pregnancy test not to long ago and it had a faint but visible line so I figured I was pregnant but I took another last night (the kind that estimates how far along you are) and it came up negative and I my period started today... What happened?