[1.7.x] Fixed #23474 -- Prevented migrating backwards from unapplying the wrong migrations.

Backport of abcf28a076 from master
[1.7.x] Fixed #23486 -- Corrected makemigrations output in tutorial 1.

Thanks nmarler for the report.

Backport of 0d1561d197 from master