How could you be so delusional not to understand that others don't know the specifics of your problem? Put yourselves in our shoes. How are we supposed to help you solve your problem if we don't know exactly what your problem is?
Specifically, what emulator (and version) are you using? What game are you playing? What actions did you take specifically? If you don't tell us vital information like that, we can't help you find solutions.
In general, when talking about something and using pronouns like "it", you must first define "it". This is something that should have been learned in infancy. I'm sorry, but I just don't understand how you missed this seemingly-automatic lesson in life.
Edit: Okay. I'm sorry for the above. My best advice is this: Put your emotions aside for now. We all know that losing hard work to desynchronization glitches sucks, but you'll have to ignore the anger and frustration that event generated so you can figure out how avoid the same loss occurring in the future. While you are in this calmer state, you can figure out the cause of the problem much more easily. Focus on details which would relate to the cause of this problem, like, 1, the emulator version you're using and, 2, the things which have changed between the time you recorded the input and the time you played it back.
Older emulators have had synchronization issues, which have generally been fixed with more recent versions. There is a very helpful article on this site which should explain this much better than I can:
http://tasvideos.org/DesyncHelpTAS.html
I recommend reading that entire page. It's possible that the specific problem you've had is there. It has good reminders for what can prevent desynchronization.