How is this possible?

I've heard from countless places the same thing on the scope of variables: once you enter a sub-scope and leave that sub-scope, any variables created or changes made to existing variables are destroyed.

But that's not true if you define a new variable in the nested scope with the same name. Then the inner name hides the outer name and changes made are to the inner name, which is destroyed when execution leaves the nested scope:

So only variables defined in that scope are destroyed? Is it true in all cases that a variable defined outside a scope and used inside a sub-scope will, after the sub-scope has been executed, retain the value that was set to it, if there was any change, in the sub-scope?

Is it true in all cases that a variable defined outside a scope and used inside a sub-scope will, after the sub-scope has been executed, retain the value that was set to it, if there was any change, in the sub-scope?

Well, technically, yes. But apparently no, because the sub scope could be function, and by default, C++ is pass-by-value. In that case you'd make a copy, edit the copy, and the changes made won't be mirrored in the calling function. You can use a reference or a pointer to fix that though.

int factorial = 1;
for (int x = 2; x <= num; ++x)
factorial = factorial * x;
cout << num <<"! = " << factorial <<"\n";
//Since factorial is declared outside of the for-loop, it is still in scope here.
//It will stay in scope until a } is encountered, probably at the end of this function.
//This means any changes made to it are kept until a } is encountered.

While you're here, could you explain if it is possible to and why using an increment or decrement operator would have a different effect on something than adding or subtracting 1 to or from it respectively?

it wouldn't have any different effect as an end result, if there is any difference it would be that ++ and -- compile to increment and decrement instructions. (most archs support them) instead of addition and subtraction instructions.

++ and -- only for convenience.

edit: There is one thing you can do, the pre-increment and decrement operators for example:
boat = theJunk[++i] ;
would first increment i then set boat to theJunk[i] while:
boat = theJunk[i++]
would set boat to theJunk[i] and then increment i