We all have things in our past that we'd like to forget - bad break-ups, traumatic experiences, loss. No matter how hard we try, these memories can continue to haunt us, occasionally triggering conditions such as anxiety, phobias, or post-traumatic stress disorder. But scientists are now on the verge of being able to change that for good, with the discovery that our memories aren't as permanent as we once thought.

In fact, researchers have now figured out how to delete, change, and even implant memories - not just in animals, but in human subjects. And drugs that rewire our brains to forget the bad parts are already on the horizon, as PBS documentary Memory Hackers highlighted over the weekend.

If it all sounds a little science fiction, that's because it is - films such as Eternal Sunshine for the Spotless Mind and Total Recall have long toyed with the idea of altering our memories. But thanks to the advances in neurological scanning technology over the past few decades, we're now closer than you might realise to making these technologies (or something similar) a reality.

So how do you go about deleting a memory? To understand that, you need to understand how memories form and are kept alive in our brains in the first place.

In the past, scientists used to think that memories were stored in one specific spot, like a neurological file cabinet, but they've since realised that every single memory we have is locked up in connections across the brain.

To explain it simply, a memory is formed when proteins stimulate our brains cells to grow and form new connections - literally rewiring our minds' circuitry.

Once that happens, a memory is stored in your mind, and for most of us, it'll stay there as long as we occasionally reflect upon it or revisit it. 

So far, so simple. But what many people don't realise is that those long-term memories aren't stable. In fact, every time we revisit a memory, that memory becomes malleable again, and is reset stronger and more vividly than before.

This process is known as reconsolidation, and it explains why our memories can sometimes change slightly over time - for example, if you fell off your bike, each time you remember it and get upset about it, you're restrengthening the connections between that memory and emotions such as fear and sadness. Eventually just the thought of a bike could be enough to make you terrified. Alternatively, most of us have had the experience of a once-traumatic memory becoming laughable years later.

The reconsolidation process is so important, because it's a point at which scientists can step in and 'hack' our memories.

"The research suggests memories can be manipulated because they act as if made from glass, existing in a molten state as they are being created, before turning solid," Richard Gray explains for The Telegraph. "When the memory is recalled, however, it becomes molten again and so can be altered before it once more resets."

Numerous studies have now shown that by blocking a chemical called norepinephrine - which is involved in the fight or flight response and is responsible for triggering symptoms such as sweaty palms and a racing heart - researchers can 'dampen' traumatic memories, and stop them being associated with negative emotions.

For example, at the end of last year, researchers from the Netherlands demonstrated they could take away arachnophobes' fear of spiders by using a drug called propranolol to block norepinephrine.

To figure this out, the team took three groups of arachnophobes. Two of these groups were shown a tarantula in a glass jar to trigger their fearful memories of spiders, and were then either given propranolol or a placebo. The third group was simply given propranolol without being shown a spider, to rule out the possibility that the drug on its own was responsible for reducing their fear.

Over the next few months, the groups were all presented with another tarantula and their fear response was measured. The results were pretty incredible - while the group given the placebo and those given propranolol without being exposed to a spider showed no change in their fear levels, arachnophobes who were shown the spider and given the drug were able to touch the tarantula within days. Within three months, many of them felt comfortable holding the spider, and their fear hadn't come back even after a year. It was like their fear had been deleted.

The same drug was also tested back in 2007 on victims of a past trauma. The participants were given either propranolol or a placebo each day for 10 days, and were asked to describe their memories of the traumatic event.

Those that were given the drug didn't forget the experience, but a week later they were able to recount it with much less stress than they originally had. In mice, a similar technique has been used to make mice 'forget' that a particular sound was associated with an electric shock, while leaving other memories intact.

So far, researchers haven't tried to explicitly delete a memory in its entirety from humans (that we know of, at least), due to the ethical implications, but the evidence suggests that it's something that would be possible, given the right combination of drugs and recall exercises.

Perhaps even more worrying is the research into how easy it is for scientists to implant false memories into people. By manipulating the same reconsolidation process, psychologist Julia Shaw has shown that it's possible to make people remember a crime they never committed - and even provide vivid details about the fictional event. 

You can see her work in action below, and it's pretty terrifying:

With this type of memory alteration already possible, and further research being conducted all the time, the real question now is, what do we do with this knowledge?

As creator of Memory Hackers, Michael Bicks, told Co.Create, ultimately the purpose isn't to delete people's painful memories entirely, like they attempt to do in Eternal Sunshine for the Spotless Mind, but simply tweak them so they're less upsetting. Because it's not so much the memories, but the associations they have in our minds, that cause us pain.

Most importantly, the research means that scientists might soon be able to help treat people with anxiety, phobias, and PTSD. 

"Rewriting memories allows you to update them," said Bicks. "But the purpose of forgetting is not just so you can clean off the hard drive … The ability to forget the unpleasant things allows us to create a story about ourselves that we can live with."