Potty trained toddler suddenly not??

My toddler (2 in a half year old) was potty trained fully in September. She was doing great, didn’t have any accidents for weeks. Then accidents would happen sometimes but it was just occasionally. Then one day she just decided she won’t use her potty anymore to pee. She will just use it to go poop. So she just keeps holding her pee for hours then peeing her pants. She will then take them off and request new underwear and pants. Even if I remind her to go to the potty or ask her or even try to guide her she just yells “no!” How do I fix this? I don’t really want to put her in pull ups.