First you need download and install Scroll Reverser:
Then you must add the app to Autostart. Now open System Preferences, and click on the Users & Groups icon. Find your account on the left-hand side (already selected), and then click on the Login Items tab.
Reboot your Mac.
A new icon will appear in the taskbar at the top. Click on it and set the mood as you need. After that, your mouse and magic trackpad will work as configured.