In my case, there was no need to remove any package. The only line which was missing in /usr/share/X11/xorg.conf.d/40-libinput.conf was:

Option "NaturalScrolling" "on"

so the whole section looked as the following:

Section "InputClass" Identifier "libinput pointer catchall" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Option "NaturalScrolling" "on" Driver "libinput" EndSection

After restart of X session my mouse worked correctly.