I've heard it said that meditation is not a linear path and that every time you sit is like the first time but that you get better at sitting for the first time. If this is the case and you don't actually make gains in a linear way then can it also be said that if you stop doing it that you will not go backwards or lose what you have learnt because you didn't go anywhere to begin with?
Meditation is not linear, as it involves the whole of ourselves. There is one part/side of us that is connected to our rationality, logic, linear thinking, and understanding. The other side of us is connected to feelings, nurturing, caring, compassion, love, and all the emotional qualities. This is how our right and left hemisphere in the brain is programed. The left side of the brain processes information in a linear manner. It processes from part to whole. It takes pieces, lines them up, and arranges them in a logical order; then it draws conclusions. The right brain however, processes from whole to parts, holistically.
Intellectual understanding about meditation is never the same as the actual experience of it. It is similar to that of having to bite into a mango to know its taste. We can read everything that there is about a mango – that it can be sweet, delicious, soft, etc. but we cannot imagine its taste unless we get the feeling of the mango on our tongue and have the personal experience. Then we can no longer debate whether the mango is sweet or not, because we have experienced the truth. This is the difference between just thinking or thinking coupled with the experience of feeling.
Once the meditator goes beyond the second Jhana level, the internal thinking comes to a stop, and memory of past experiences never come up. From there on there is no such thing as a linear process. From there on it is total awareness in staying with the breath. This is being one with your meditation. This is ekaggata, as in ekaggatarammana, oneness of preoccupation, or singleness of preoccupation; and ekaggatacitta, singleness of mind. This kind of oneness applies to all levels of jhana. It means being focused on one thing, like the breath. You stay steadily focused on it, at the same time making it the one thing filling your range of awareness.
While your question appears rational, I will argue that it is not and conclude with an answer to the spirit of your question based on canonical sources. Your question is presented in two clauses. Therefore:
First, I believe it is critical to suffer through a deconstruction of your reasoning. Second, as meditation is ill-defined here, this answer will presume the broadest non-technique specific definition inclusive of samatha and vipassana. Third, as I believe you have been exposed to a teaching out of context, I will attempt to rein in the exuberance of composition present in your question with some doctrine.
I've heard it said that meditation is not a linear path and that every time you sit is like the first time but that you get better at sitting for the first time.
What you have heard is not unreasonable. It is a teaching that desperately needs context. Linearity is a rational property (relationship or function) that represents directional succession of measurable intervals. Linearity is a concept present in math, art, science, logic, and music. In the broadest sense, for linearity to be rational, there must exist one of two conditions: 1) an origin and a destination or 2) an origin and a directional vector. In order for linearity to be captured or shared in any meaningful or actionable way, there must be rational measurement.
Briefly, as to origin, it is generally safe to presume for argumentation in this context that the origin is the you of now. But this is not as trivial as it may appear. Because the you of now is not the same you of the now just a moment ago when you began this paragraph. "Is this you of the now more or less informed than a hypothetical you at another now?" Put another way, "How are the things unknown to you different now than at any other moment?" Or in the form of a koan, "What do I not know?" You are not static and thus neither is you as an origin. The now shatters the illusory origin and makes both destinations and vectors equally fantastic. All we have is now.
There is also the notion that linearity is singular; that is, it cannot represent multiple measurements or states simultaneously. And briefly stipulating to quantum mechanics, it is certainly possible to argue the possibility of infinite, omni-directional linearity, but then if one has reached such a conclusion, such infinite linearity, when aggregated to now, is self-canceling; such that, linearity is again moot.
If this is the case and you don't actually make gains in a linear way then can it also be said that if you stop doing it that you will not go backwards or lose what you have learnt because you didn't go anywhere to begin with?
As to gains, your premise begins with a fallacy -- that, "gains" (or progress, development, cultivation) are dependent on linearity. This premise does not withstand scrutiny because it presumes to the singular; that gains are not gains if they are do not fall within a specific succession of measurable intervals.
Additionally, in this context forward and backward are value judgments. If we suspend judgment then "backwards" simply indicates gain of a different sort, which is entirely possible. However, it can not be substantiated that lack of effort results in regression (negative gains) simply because gains are correlated to effort. It is far more reasonable to assert that effort results in gain and non-effort results in non-gain.
While interesting for some, I respect this may be a bit mind-numbing for others. So what does this mean in a more doctrinal sense?
The first time we sit, everything is new and we are confronted by the unknown. As we sit, we cultivate. What is cultivation? Cultivation is at the heart of "right effort" (Samma Vayama) and "right concentration" (Samma Samadhi).
We begin not knowing what we do not know (the unrisen). In our sitting, something unknown (unrisen) may become known to us (arise within). This may be something as simple as a whisp in the wind of the passing monkey mind activity. Or it may be as complex as the (re)introduction to sense experience. Or it may be something entirely personal or unique to that particular place in time. Once arisen, we gain awareness. With awareness, we have less claim to the mental fermentation associated with ignorance and are charged to be heedful.
Our right effort suggests four great endevours: 1) to prevent the arising of unarisen unwholesome states; 2) to abandon unwholesome states that have already arisen; 3) to arouse wholesome states that have not yet arisen; 4) to maintain and perfect wholesome states already arisen.
"The Buddha recommended the four supreme efforts as skillful means. They are called 'supreme' because they are supremely difficult and supremely beneficial."
"Being Nobody, Going Nowhere: The Foundation of Buddhist Thought", Volume 3, By Geshe Tashi Tsering, Ayya Khema
"For a disciple who has conviction in the Teacher's message & lives to penetrate it, what accords with the Dhamma is this: 'Gladly would I let the flesh & blood in my body dry up, leaving just the skin, tendons, & bones, but if I have not attained what can be reached through human firmness, human persistence, human striving, there will be no relaxing my persistence.'"
Our right concentration suggests exertion activates five mental factors. Stated in their usual order the five are: initial application of mind (vitakka), sustained application of mind (vicara), rapture (piti), happiness (sukha), and one-pointedness (ekaggata). When concentration is cultivated, these five factors arise and counteract the five hindrances. Each mental factor factor opposes a particular hindrance. 1) Initial application of mind, through its work of lifting the mind up, counters dullness and drowsiness. 2) Sustained application, by anchoring the mind, drives away doubt. 3) Rapture denies ill will, 4) happiness excludes restlessness and worry, and 5) one-pointedness counters sensual desire, which may arguably be the most alluring inducement to distraction. Thus, with the strengthening of the absorption factors, the hindrances fade out and subside.
So, in conclusion, speaking to the spirit of your question:
Cultivation and practice is both sufficient and necessary to (using your word) "make gains". Lack of effort may be a sufficient condition for unrisen unwholesomeness, but it is not a necessary condition. Can one lose or forget what one has learned? Certainly. But one may just as easily forget to apply/practice what one has learned without losing the learning.
If one is judging outcomes, meditate on the difference between not knowledge and practice.
Ajaan Fuang Jotiko has some relevant advice for you in the compilation "Awareness Itself" (compiled and translated by Thanissaro Bhikkhu):
§ "The mind is like a king. Its moods are like his ministers. Don't be a king who's easily swayed by his court."
§ One meditator noticed that his practice under Ajaan Fuang was making quick progress, and so he asked what the next step would be. "I'm not going to tell you," Ajaan Fuang said. "Otherwise you'll become the sort of amazing marvel who knows everything before he meets with it, and masters everything before he's tried his hand. Just keep practicing and you'll find out on your own."
§ "You can't plan the way your practice is going to go. The mind has its own steps and stages, and you have to let the practice follow in line with them. That's the only way you'll get genuine results. Otherwise you'll turn into a half-baked arahant."
§ "Don't make a journal of your meditation experiences. If you do, you'll start meditating in order to have this or that thing happen, so that you can write it down in your journal. And as a result, you'll end up with nothing but the things you've fabricated."
§ A young nurse practiced meditation with Ajaan Fuang several days running, and finally asked him one day, "Why wasn't today's session as good as yesterday's?"
He answered: "Meditating is like wearing clothes. Today you wear white, tomorrow red, yellow, blue, whatever. You have to keep changing. You can't wear the same set of clothes all the time. So whatever color you're wearing, just be aware of it. Don't get depressed or excited about it."
§ A few months later the same nurse was sitting in meditation when a sense of peace and clarity in her mind became so intense that she felt she would never have a bad mood infiltrate her mind again. But sure enough, bad moods eventually came back as before. When she mentioned this to Ajaan Fuang, he said, "Looking after the mind is like raising a child. There will have to be bad days along with the good. If you want only the good, you're in for trouble. So you have to play neutral: Don't fall in with the good or the bad."
§ "When the meditation goes well, don't get excited. When it doesn't go well, don't get depressed. Simply be observant to see why it's good, why it's bad. If you can be observant like this, it won't be long before your meditation becomes a skill."
§ One day a young woman was sitting in meditation with Ajaan Fuang and everything seemed to go well. Her mind was clear and relaxed, and she could contemplate the elements in her body as he told her, step by step, with no problem at all. But the next day, nothing went right. After the session was over, he asked her, "How did it go today?"
She answered, "Yesterday I felt as if I were smart, today I feel like I'm stupid."
So he asked her further, "Are the smart person and the stupid person the same person or not?"
§ A student came to complain to Ajaan Fuang that she had been meditating for years, and still hadn't gotten anything out of it. His immediate response: "You don't meditate to 'get' anything. You meditate to let go."
§ The seamstress, after practicing meditation with Ajaan Fuang for several months, told him that her mind seemed more of a mess than it was before she began meditating. "Of course it does," he told her. "It's like your house. If you polish the floor every day, you won't be able to stand the least little bit of dust on it. The cleaner the house, the more easily you'll see the dirt. If you don't keep polishing the mind, you can let it go out and sleep in the mud without any qualms at all. But once you get it to sleep on a polished floor, then if there's even a speck of dust, you'll have to sweep it away. You won't be able to stand the mess."