amending previous commit, forgot to reverse commands in restore loop