netsh equivalent in OSX
A netsh counterpart for manipulating network settings would be the networksetup command, but to achieve what you want, the easiest would be to define two separate network locations in GUI, one with static IP, the other one with DHCP. Then execute:

# scselect
Defined sets include: (* == current set)
   02080D27-B377-4942-BB3A-CF0C8F049F9E (static IP)
 * 0F27B96E-9B5A-4FAE-B639-C374BD77C1A6 (DHCP)


Take note of the GUID and execute the following to switch:

# scselect 02080D27-B377-4942-BB3A-CF0C8F049F9E


You can write a more friendly script with grep and sed to suit your taste.