There are a few mistakes in your rig that are causing you the problems you are seeing.
First, the chain length on the leg IK bones is set to 0. You'll want to set it to 2. What the chain length does is determine how many bones the IK constraint will affect. 0 means that moving the foot bone around will affect every bone in the chain, which includes the hip bone, while setting it to 2 will make it affect only the shin and thigh bones. Your IK foot bone should only be affecting the leg, and not the hips. You'll need to change this for both IK constraints.
Second, you have the location on your foot bones locked. This isn't necessarily a bad thing, but from looking at your file it appears this was done to 'fix' another issue, but after properly fixing everything it won't be necessary.
Which brings me to issue 3. This is the issue that's causing you most of the problems. Your foot bones which are used to control the legs via the IK constraint, are still parented to the legs. What's happening is you have a circular relationship going in here. Your foot bone is telling your leg bones where to be because of the IK constraint, while the leg bones define the position on the foot bones since they are connected. That is why any edit such as changing to rest pose and back or going into edit mode and back are causing issues. Locking the foot bones location seemed to be what you did to fix this issue, but as you found out it doesn't truly fix it.
To fix the IK issue, you'll want to (in edit mode) duplicate each foot bone, rename them to be Foot_IK.R/L or something like that, clear the parent on them with Alt-P, and use them as the Bone in the IK constraint. You can also then add a copy rotation constraint to the original foot bone and have it copy the rotation of the new IK bone so that the IK bone can control the whole foot. You will most likely have to set the space from world space to local space in both menus to ensure it works properly.
The reason for using a separate bone instead of clearing the parent on the foot bone is that using the foot bone as the control will also allow you to pull the foot bone away from the ankle, stretching the leg. Using a separate bone will just fully extend the leg and not stretch any of the leg.
I think you should only have to reposition the foot IK bones once you've made all of these changes, so you won't have to redo much.