I have no idea what happened but when I move my fingers on the touchpad up and down the mouse pointer scrolls left to right instead and when I scroll left to right it scrolls up and down. How do I fix this?
Aaron Miller's comment pointed me to a solution. I had the same problem with inverted axis for my Elan touchpad.
I went to Screen Resolution Settings, and switched the Orientation from Landscape to Portrait, and then to Landscape again. And now it's fixed.
It seems that when I used an external device that had mouse tracking included (Virtual Reality Headset), I changed the orientation to Portrait for that device, but when I unplugged it, Windows didn't return to Landscape orientation, leaving me with the mouse pad on Portrait.