The Kepler orbit of the Earth around the Sun is determined by two constants: the
specific orbital energy $E$ and the specific relative angular momentum $h$:
$$
\begin{align}
E &= \frac{1}{2}v_{r,\oplus}^2 + \frac{1}{2}v_{T,\oplus}^2 - \frac{\mu}{r}= -\frac{\mu}{2a},\\
h^2 &= r^2\,v^2_{T,\oplus} = \mu a(1-e^2),
\end{align}
$$
where $\mu = G(M_\odot + M_\oplus)$, $r$ is the distance Earth-Sun (at the moment of impact), $a$ is the semi-major axis, $e$ is the orbital eccentricity, $v_{r,\oplus}$ is the radial orbital velocity of the Earth, and $v_{T,\oplus}$ the tangential velocity. Now, suppose that a large asteroid collides with the Earth, with orbital velocity $(v_{T,A},v_{r,A})$ and mass $M_A$. Its relative velocity is then
$$
\begin{align}
v_{T,A}' &= v_{T,A} - v_{T,\oplus},\\
v_{r,A}' &= v_{r,A} - v_{r,\oplus}.
\end{align}
$$
We can express these relative velocities in terms of the total impact velocity $v_\text{i}$ and the impact angle $\theta$:
$$
\begin{align}
v_{T,A}' &= v_\text{i}\cos\theta,\\
v_{r,A}' &= -v_\text{i}\sin\theta,
\end{align}
$$
where I defined $\theta$ as in Fig. 1 of this article. So we obtain
$$
\begin{align}
v_{T,A} &= v_{T,\oplus} + v_\text{i}\cos\theta,\\
v_{r,A} &= v_{r,\oplus} - v_\text{i}\sin\theta.
\end{align}
$$
If we assume that the collision is central, that heat loss is negligible and that the debris remains gravitationally bound to the Earth, then conservation of momentum implies
$$
\begin{align}
M_\oplus\,v_{T,\oplus} + M_A\,v_{T,A} &= (M_\oplus+M_A)u_{T,\oplus}\\
M_\oplus\,v_{r,\oplus} + M_A\,v_{r,A} &= (M_\oplus+M_A)u_{r,\oplus},
\end{align}
$$
with $(u_{T,\oplus},u_{r,\oplus})$ the new orbital velocity of the Earth (and the gravitationally bound debris) after the impact. We get
$$
\begin{align}
u_{T,\oplus} &= v_{T,\oplus} + \frac{M_A}{M_\oplus+M_A}v_\text{i}\cos\theta,\\
u_{r,\oplus} &= v_{r,\oplus} - \frac{M_A}{M_\oplus+M_A}v_\text{i}\sin\theta.
\end{align}
$$
So the orbital energy and angular momentum will have changed into
$$
\begin{align}
E' &= \frac{1}{2}u_{r,\oplus}^2 + \frac{1}{2}u_{T,\oplus}^2 - \frac{\mu}{r}= -\frac{\mu}{2a'},\\
h'^2 &= r^2\,u^2_{T,\oplus} = \mu a'(1-e'^2).
\end{align}
$$
(the change in $\mu$ is negligible). Right, let's plug in some numbers. Suppose we start with a circular orbit, with a radius equal to the present-day semi-major axis:
$$
\begin{align}
\mu &= 1.32712838\times 10^{11}\;\text{km}^3\,\text{s}^{-2},\\
r &= a = 1.49598261\times 10^{8}\;\text{km},\\
e &= 0.
\end{align}
$$
For a circular orbit, it follows that
$$
\begin{align}
v_{T,\oplus} &= \sqrt{\frac{\mu}{r}}= 29.785\;\text{km}\,\text{s}^{-1},\\
v_{r,\oplus} &=0\;\text{km}\,\text{s}^{-1}.
\end{align}
$$
The impact velocity of an asteroid will always be at least equal to the Earth's escape velocity $11.2\,\text{km/s}$, which is the speed it takes up as it falls into the Earth's gravitational potential well. The article that I already linked to states that typical asteroid impact velocities are in the range of $12-20\,\text{km/s}$. In theory, the impact velocity can be as large as $72\,\text{km/s}$ in the case of a head-on collision, when the Earth and the asteroid have opposite orbital velocities, thus a relative velocity of ~$60\,\text{km/s}$, augmented with the escape velocity as the asteroid falls into our gravitational potential well. This is very unlikely for asteroids, but it is possible for comets.
So, let us assume a typical impact velocity $v_\text{i}=16\,\text{km/s}$,
a mass $M_A = 0.1M_\oplus$ and an impact angle $\theta=45^\circ$. We find
$$
\begin{align}
u_{T,\oplus} &= 30.813\;\text{km}\,\text{s}^{-1},\\
u_{r,\oplus} &= -1.0285\;\text{km}\,\text{s}^{-1},\\
E' &= -411.87\;\text{km}^2\,\text{s}^{-2},\\
h'^2 &= 2.1248\times 10^{19}\;\text{km}^4\,\text{s}^{-2},\\
a' = -\frac{\mu}{2E'} &= 1.61109\times 10^8\;\text{km},\\
e' = \big[1- h'^2/(\mu a')\big]^{1/2} &= 0.0788,\\
r_\text{p} = a'(1-e') &= 1.48411\times 10^8\;\text{km},\\
r_\text{a} = a'(1+e') &= 1.73807\times 10^8\;\text{km},
\end{align}
$$
with $r_\text{p}$ and $r_\text{a}$ perihelion and aphelion. Evidently, the influence on the Earth's orbit is substantial.
In the case of a direct-from-behind collision, we get $\theta=0^\circ$, $v_\text{i}=11.2\,\text{km/s}$, so that
$$
\begin{align}
u_{T,\oplus} &= 30.803\;\text{km}\,\text{s}^{-1},\\
u_{r,\oplus} &= 0\;\text{km}\,\text{s}^{-1},\\
E' &= -412.72\;\text{km}^2\,\text{s}^{-2},\\
h'^2 &= 2.1234\times 10^{19}\;\text{km}^4\,\text{s}^{-2},\\
a' = -\frac{\mu}{2E'} &= 1.60778\times 10^8\;\text{km},\\
e' = \big[1- h'^2/(\mu a')\big]^{1/2} &= 0.0695,\\
r_\text{p} = a'(1-e') &= 1.49598\times 10^8\;\text{km},\\
r_\text{a} = a'(1+e') &= 1.71958\times 10^8\;\text{km}.
\end{align}
$$
As expected, the radius at impact has become the perihelion, and the change in eccentricity is lowest.
And just for fun, let's try the worst-case scenario: $\theta=180^\circ$, $v_\text{i}=72\,\text{km/s}$:
$$
\begin{align}
u_{T,\oplus} &= 23.239\;\text{km}\,\text{s}^{-1},\\
u_{r,\oplus} &= 0\;\text{km}\,\text{s}^{-1},\\
E' &= -617.10\;\text{km}^2\,\text{s}^{-2},\\
h'^2 &= 1.2086\times 10^{19}\;\text{km}^4\,\text{s}^{-2},\\
a' = -\frac{\mu}{2E'} &= 1.07530\times 10^8\;\text{km},\\
e' = \big[1- h'^2/(\mu a')\big]^{1/2} &= 0.391,\\
r_\text{p} = a'(1-e') &= 0.65462\times 10^8\;\text{km},\\
r_\text{a} = a'(1+e') &= 1.49598\times 10^8\;\text{km},
\end{align}
$$
so that the radius at impact has become the aphelion, and the change in eccentricity is highest. Although I wonder how much would be left of the Earth after such an apocalyptic event...
If the collision isn't central, then part of the energy will be transferred to the axial rotation of the Earth, which should reduce the effect on the orbit. But that will be more difficult to quantify.
The material in the Earth's outer core is both a liquid and an electric conductor. Fluid flow is driven by thermal convection currents. The source of heat driving the convection is the decay of radioactive elements that are also carried by the fluid flow. Fluid flow and electric currents are coupled through electromagnetic forces. The core is also likely of inhomogeneous composition. Charge is not only carried along by the fluid flow, electromagnetic induction can create eddy currents. The equations describing this very complex system cannot be solved without fairly large computers. Numerical models of the Earth's magnetic field indicate that the field is 'chaotic' - spontaneously changing its shape and polarity. Because of this complexity, it is not necessary that the direction of flow to reverse everywhere for the direction of electric currents to change and cause the magnetic field to change too. Because the system is 'chaotic', a relatively small change in flow might cause a large change (even reversal) of the magnetic field. Although the computer models are simulations, they have become very good at reproducing the secular variation of the magnetic field we observe at the Earth's surface.
You would have to get the technical and mathematical details out of the scientific literature.
The previously cited article from National Geographic is a good popular article, the researchers interviewed are still active and you go search for their latest publications.
I don't have a single technical seminal citation to give, but one place you might start researching the literature is the web pages of the Geomagnetism & Paleomagnetism Section of the American Geophysical Union (AGU). You'll find information there for both researchers and students. Look for information on the web at other non-US National surveys as well for terms such as "Geomagnetism" and "Geodynamo."
I still like the 2010 book: "North Pole, South Pole: The Epic Quest to Solve the Great Mystery of Earth's Magnetism" by Gillian Turner. A non-mathematical treatment of the history, written by a geophysicist, but also gives the names of scientists are still actively conducting research, search to see what they and their students may be writing about today.
Best Answer
The Earth's climate isn't quite as stable as you think. The Earth's climate has toggled back and forth between a greenhouse Earth and an icehouse Earth for the last 600 million years or so. During the icehouse Earth phases, the climate can enter an ice age, an extended period of time during which the climate in oscillates between glaciations and interglacials. We are currently in the midst of an interglacial period of an ice age. On the flip side of the icehouse Earth climate, dinosaurs and tropical plants lived close to the poles when the Earth was in a greenhouse phase.
In the past, there was a third climate phase, snowball Earth, which made the icehouse Earth look mild in comparison. Even during the worst glaciation, ice rarely reached closer than 40 degrees latitude of the equator. During snowball Earth phases (that last of which ended over 600 million years ago), ice reached well into the tropics, and possibly all the way to the equator.
One of the open issues in paleoclimatology is explaining why the early young Earth wasn't perpetually stuck in the snowball Earth phase. The Sun's luminosity has been growing in intensity since it formed. Sunlight was only 75% to 85% as intense when the Earth was young as it is now. So why wasn't the Earth permanently frozen long, long ago? Explaining why this was not the case (and geological evidence says it wasn't) is the faint young sun problem.
Regarding Mars, that's fairly simple. Mars is too small.
Mars's core froze long agoMars magnetic dynamo stopped operating long ago, and if Mars ever did have plate tectonics, that process stopped long ago. The end of plate tectonics stops any outgassing that would otherwise have replenished the atmosphere. That Mars is small means it has a tenuous hold on its atmosphere. The loss of a magnetic field (if it ever had one) would most likely have exaggerated the atmospheric loss, particularly if this happened when the Sun was young and had a much greater solar wind than it has now. The combination of the above means that even if Mars was habitable long, long ago, that habitability was rather very short lived.Regarding the giant impact hypothesis, you have it exactly backwards. Look to our sister planet. Venus has a very thick atmosphere and as a result has surface temperatures higher than those on Mercury. The giant impact hypothesis offers one explanation for why Earth is not like Venus. If it wasn't for that impact, the Earth would still have a thick primordial atmosphere and we wouldn't be here. Our planet would be uninhabitable. Mars would be habitable if it was the same size as the Earth or Venus and if it had a Venus-like atmosphere.
Update: Regarding Anthropogenic Global Warming
A number of comments has taken this answer to be proof that anthropogenic global warming is not happening. To the contrary, it most certainly is happening.
As an analogy, consider a farmer who takes a trip to the Grand Canyon, then Badlands National Park, and then the Channeled Scablands in eastern Washington state. The farmer can rightfully conclude that nature has destructive capabilities that can far outdo even the very worst of farming practices. He cannot however conclude that poor farming practices do not cause erosion based on the existence of those remarkable records of natural erosion.
The extent to which anthropogenic global warming is happening and what that means to humanity -- that's a different question and should be asked as such. What the long term variations in the Earth's climate as described in this answer mean to humanity, well that too a different question.