The sack of potatoes had been placed below the bag of flour , so *it* had to be moved first.

Do "it" and "the bag of flour" mean the same thing?
yes