Auto trans in jeep quit then started working now it whins in reverse on 1997 Jeep Wrangler

Was driving it and it quit moving like it was in neutral. Selector moved into all the gears, but wouldn't move had to have towed. But later It started working again. Forward and reverse. I drove it around the block it shifted but the longer I drove it around the shifting was longer and when I got back, it was close but I made it back. And when I put it in reverse it started whinning. I had the filter and fluid in the pan replaced and it worked good for a couple weeks. It was whinning before I had filter changed.

Asked by for the 1997 Jeep Wrangler