Bournemouth came back from 2-0 and 3-1 down to snatch a stunning 4-3 win over Liverpool in a thrilling match on the south coast.