OK I suppose you work with version control? At this point, it is very important to determine what constitutes โAโ and โBโ. If we swear / guess that this amorphous code of the code we are referring to is โAโ, and this other vague thing that we all call โBโ, this will not work.
If you are trying to reinstall "A" instead of "B", you have two options: 1) check and restore "A" from scratch (synchronization and migration) 2) flip "B" back to "A".
1) This probably will not work, because you cannot afford to kill data in the database in order to synchronize it from nothing 2) Involves migration. First, you should find the migration in "B", not in "A". In the south, all migrations for each application are numbered (0001, 0002, 0003, etc.). So let โBโ be at 050 and โAโ at 0031. While you select โBโ, run python manage.py migrate appname 0031 This will python manage.py migrate appname 0031 all the changes to the database that you made for โBโ . Then in your version control system you check for "A" ("A" is just a commit or tag or branch)
Unfortunately, you cannot roll back to "A" and then say "undo everything that you don't have." This would be an easier solution - but then you need a migration system to find out about your version control system, and it's a little hairy.
Johno source share