a commercial aircraft that was traveling from Madrid to Toronto and could not ascend to a higher altitude due to GPS Jamming
Intentional jammers are easily localized and thrown to jail. It's very dubious a jammer was on the route Madrid-Toronto, mostly over the ocean.
In short
It's not possible to recover a jammed/spoofed GNSS signal. The reason is the original signal is not received, it is flooded by the jammer which signal is stronger than the satellite one at the reception point.
For a receiver, the satellite signal strength is quasi-constant, but the jammer signal, initially faint, has a strength multiplied by 4 each time the distance is halved. At some point the jammer is stronger than the satellite.
But even with a 1kW transmitter and an antenna with a significant gain, the jammer is not going to cover a large radius unless operating many distributed transmitters. This is practically feasible but not useful for the goals of the jammer.
With a jamming station on the ground, a potential solution for an aircraft in altitude is to use a more directional GNSS antenna shielding sources with a low elevation. Shielding is done by using choke rings. This type of antenna is commonly used on fixed stations to eliminate GNSS signals reflected by the ground or the buildings.
(Source.)
However this might also shield some satellites and decrease position accuracy. Satellites with a low elevation are useful to limit the dilution of precision.
With airborne jamming, the situation is different, but the solution is similar, instead of using a mechanical shielding, the receiver uses beam forming/steering techniques to eliminate certain solid angles from the radiation pattern of the receiver antenna. Such solution is sold, e.g. by Thales under the name TopShield.
On the other hand, for civil aviation, having the GNSS jammed is definitely not big business. GNSS are not the only navigation systems in the cockpit, navigation was possible prior to the advent of the GPS. An aircraft can use its 2 or 3 inertial systems to fly and reach an airport equipped with an ILS without GNSS positioning. The accuracy of the inertial system decreases with as time passes, but this is not a problem when the jammed area is limited, which is always the case.
Limited jammed radius
As a matter of fact, current jamming activities are local, mostly Russian Federation hampering precise Ukrainian strikes (map width is about 5500km):
(Source.)
To begin with, commercial aircraft are not likely to enter these conflict areas, but if they did, they can easily navigate 10 or 20 minutes without any GNSS position. This poses absolutely no threat to the aircraft or the other aircraft.
DSP and M-Code
Can commercial aircraft be equipped with ECM and ECCM equipment?
In theory digital techniques in the aircraft could help reduce jamming effects using more intensive (hence slower) processing (DSP), and extracting required information from partial navigation signals, e.g. missing the ephemeris or the almanac information but having the atomic timestamp from the satellite.
However this is not worth the effort for civil use, the crew just switches to inertial systems which are sufficient to navigate. If you're interested you can read this article, the style is a bit dramatic but there are interesting figures.
Military have other needs and will use the future M-Code signal on the GPS constellation L1 and L2 frequencies, the project has been delayed several times.
Contrary to existing codes, M-Code is not broadcast over the whole Earth hemisphere, but M-Code is not only broadcast over the whole Earth hemisphere, but also beamed to a specific area using beam forming on the transmitter antenna. It is thus 20 or 50 times more powerful in the selected spot, making the task of the jammer more difficult. In addition M-Code will be usable even if existing C/A and P(Y) codes are themselves jammed or made inoperative by the US. (Thanks to @nanofarad for fixing my approximation!)
I'm adding some generalities about GNSS jamming.
GNSS jamming principles
The principle of GNSS jamming is to flood the spectrum around the frequencies used by the GNSS satellites to broadcast their navigation messages.
The main US GPS frequency L1 on which the navigation message is broadcast is around 1.6GHz. L2 also contains a civilian navigation message, and L5 is entirely civilian.
L5 has been designed to resist some interference, with twice a transmitting power and a longer pseudo-random sequence.
(Source. See signals carried on these frequencies here)
GNSS transmit their message from 20000km with a low effective radiated power spread over a large bandwidth, resulting in a very low power density per Hz. This is by design. This way the signal is perceived as thermal noise. Reception requires digital correlation with a known pseudo-random sequence. Modernized satellites (block III) are a bit more powerful (300W EIRP instead of 50W).
This principle has a downside: It can be flooded from the ground easily. This is what happens when a receiver is jammed. Note the worst case is not when the signal is jammed (unusable) but when it is spoofed (usable but not genuine) and appears valid to a receiver while it contains a modified navigation message, leading to a position error.
While transmitting on the same frequencies, some satellites may still be usable when other are perturbed. The reason is the relative position of the satellite, the jammer and the receiver, and the spread spectrum which portions might still be accessible.
A spoofed GNSS signal can be detected by the integrity check (RAIM) associated with the receiver, and the satellite can be rejected.
A jammed GNSS signal is not usable at all.
In both cases the original signal cannot be recovered. In some case L1 frequency can be jammed while L5 is still usable. Both signals contains appropriate civil navigation messages.