I tried jailbreaking my iphone 4 with ios 7.1.2 and something went wrong?

It didn't finish, came up with an error, and closed down. I lost several of the stock apps including the text messaging and phone apps. I reset all content and settings, but it didn't bring them back. What can i do to fix this?

Just do a factory Reset or a fresh install Via Itunes and it should come back to where it was before. I'm not a JB patriot but I would recommend using something like TiaG for the JB process it's fast and reliable.