We're looking to compute the scalar line integral
$$\int_\mathcal{C_1} (x+y) ds$$
where $\mathcal{C_1}$ is the straight line segment from $A=(1,0)$ to $B=(0,1)$.
Optimal Solution
In order to compute a line integral, we should parametrize our curve, say
$$\vec{r}(t) = \langle 1-t, t \rangle \quad 0 \leq t \leq 1.$$
Then $ds = \Vert \vec{r}'(t) \Vert dt= \sqrt{2}dt$ and so
\begin{align*}
\int_\mathcal{C_1} (x+y) ds &= \int_0^1 (1-t + t) \sqrt{2} dt \\
&= \int_0^1 \sqrt{2} dt \\
&= \sqrt{2}.
\end{align*}
Done. Note that our parametrization was from point $A$ (at $\vec{r}(0)$) to point $B$ (at $\vec{r}(1)$), with agrees with the standard orientation on the real number line (from 0 to 1).
What about the reverse orientation?
Let's parametrize from $B$ to $A$ instead, say
$$\vec{r}(t) = \langle t, 1-t \rangle \quad 0 \leq t \leq 1.$$
As before, $ds = \Vert \vec{r}'(t) \Vert dt = \sqrt{2} dt$ and again we get \begin{align*}
\int_{\mathcal{C_1}} (x+y) ds &= \int_0^1 \sqrt{2} dt\\
& = \sqrt{2}.
\end{align*}
Notice that we get the same result because $ds$ only cares about the magnitude of $\vec{r}'(t)$, not the direction. This is precisely the difference between speed and velocity.
Notice that when I wanted to do this integral with the reverse orientation, I did not just swap the bounds of integration! I found a new parametrization and I chose bounds suitable for my parametrization.
So what about the setup in the question?
Going through the entire parametrization with $\vec{r}(t)$ seems annoying; why not just use that $\overline{AB}$ is part of the curve given by $y=1-x$?
Sure, no problem. We still need to account for $ds$:
\begin{align*}
ds &= \sqrt{dx^2 + dy^2}\\
&= \sqrt{1 + \left( \frac{dy}{dx}\right)^2 } ~dx \\
&= \sqrt{1+ (-1)^2} ~dx \\
&= \sqrt{2} ~dx.
\end{align*}
All good. Let's set up our integral and go from $B$ to $A$. When $x=0$, $y=1$ and we're at point $B$ so $x=0$ is our lower limit. When $x=1$, $y=0$ and we're at point $A$ so $x=1$ is our upper limit. Here's the key bit: as $x$ goes from $0$ to $1$, it agrees with our standard orientation on the real number line, i.e., $x$ is moving to the right.
\begin{align*}
\int_\mathcal{C_1} (x+y) ds &= \int_{x=0}^1 (x + (1-x)) \sqrt{2} dx \\
&= \int_{x=0}^1 \sqrt{2} ~dx \\
&= \sqrt{2}.
\end{align*}
And the opposite direction?
We finally arrive at the crux of the matter: if we instead go from $A$ to $B$, why isn't the integral
$$\int_1^0 \sqrt{2}~dx = -\sqrt{2}$$
instead? The answer is subtle, and I'll give a couple different explanations.
When $x=1$, $y=0$ and we're at $A$ so $x=1$ is the lower limit. When $x=0$, $y=1$ and we're at $B$ so $x=0$ is the upper limit. HOWEVER, this disagrees with the standard orientation of the real number line. If I think of $dx$ as an infinitesimal step in the $+x$-direction, I'll never be able to get from $1$ to $0$ taking $dx$ steps. Instead, I need to take $-dx$ steps. Notice that
$$\int_1^0 \sqrt{2} (-dx) = \sqrt{2}$$
as desired. Perhaps think of this as what would happen when setting up a Riemann sum: I would need to have $\Delta x < 0$ to partition from $1$ to $0$.
When we set up our integral just using $y=1-x$, we were actually being really lazy about what parametrization we were defining. In particular, this corresponds to the parametrization
$$\vec{r}(x) = \langle x, 1-x \rangle \quad x \in [0,1].$$
Notice that we're suddenly using $x$ for a coordinate in $\mathbb{R}^2$ and for the parametrization variable in $\vec{r}$. In order to highlight the difference in the double duty that $x$ is being tasked with, I will use $X$ to denote the coordinate in $\mathbb{R}^2$ and $\chi$ to denote the parametrization variable:
$$\vec{r}(\chi) = \langle X(\chi), y(\chi) \rangle = \langle \chi, 1- \chi \rangle \quad \chi \in [0,1].$$
Setting up our integral, we have
\begin{align*}
\int_\mathcal{C_1} (X+y) ds &= \int_{[0,1]} (\chi + 1- \chi) \sqrt{2} d \chi \\
&= \int_{[0,1]} \sqrt{2} d \chi
\end{align*}
and we run square into the issue of how to pick our upper and lower bounds. When we parametrized with respect to $\chi$, we implicitly assumed that the orientation of $\chi$ moving from $0$ to $1$ agreed with the orientation of our curve. Perhaps mysterious, but it's really important to not confuse the multiple hats that $x$ is wearing.
Remember when I wrote that
$$ds = \sqrt{dx^2 + dy^2} = \sqrt{1 + \left( \frac{dy}{dx} \right)^2 } ~dx?$$
Yeah, that was a lie, just like saying
$3 =\sqrt{(-3)^2} = -3$
is a lie. The proper expression would be
$$ds = \sqrt{dx^2 + dy^2} = \sqrt{1 + \left( \frac{dy}{dx} \right)^2 } ~\vert dx\vert.$$
The question then becomes: When can I drop the absolute value sign? The answer to this is precisely when $dx$ is positive, i.e., when we use the positive orientation on the real numbers. If I want to use the opposite orientation on the real number line, then I need to account for this with a negative sign. Thus
$$\int_{\mathcal{C_1}} (x+y) ds = \int_{[0,1]} \sqrt{2} \vert dx \vert = \int_0^1 \sqrt{2} dx = \int_1^0 \sqrt{2} (-dx).$$
Perhaps you've studied the general change of variables formula with the Jacobian determinant? Remember how you need to take the absolute value of the determinant of the Jacobian matrix? This accounted for the possibility that your change of coordinates map $G: \mathbb{R}^m \to \mathbb{R}^n$ was orientation-reversing. It's the exact same story here, except that our change of coordinates map is from a subset of $\mathbb{R}$ to an embedding of a 1-dimensional manifold, which we call a parametrization. The Jacobian matrix will no longer be square, so we can't take the determinant. We can, however, find the singular values...
Every single integral you took in Calc I and II was actually a vector line integral, for which the orientation mattered. If you analyze an expression like
$$\int_0^1 x^2 dx,$$
it usually gets interpreted as "the area between the $x$-axis and $y=x^2$, bounded by $x=0$ and $x=1$." It absolutely does compute that the area is in fact $1/3$, but sweeps a lot of issues under the rug, i.e., what about when our curve goes below the $x$-axis? We usually account for this with some business about "signed area" and such. A more rigorous interpretation would be that we are finding the work done by the vector field $\vec{F}(x) = \langle x^2 \rangle=x^2 dx$ as a particle travels from $x=0$ to $x=1$. The issue that you ran into is that you started with a scalar line integral (orientation of the curve doesn't matter) and converted it into 1-dimensional vector line integral, where the orientation matters, by means of a parametrization. This is fine and proper, but we need to ensure that we haven't inadvertently introduced a stray negative sign when doing this translation.