The longer response in the below question thoroughly explains exactly how to resolve the duplicate id.
Xcode:The identifier IBMemberID xxx-xx-xxx is already in use by <IBUITableView: 0x7fc17df3b720>
Storyboard merge conflicts is a small issue with XCode. There's a few blogs offering strategies if you search it.
With regards to getting back your previous code, if you haven't committed yet, you can do the following in XCode:
Source Control > Discard All Changes
If you have committed or if XCode still complains after discarding changes, you can check out your last commit. You can get the 7-digit hash for that commit through terminal with:
$ git reflog
then checkout that commit just like any branch with:
$ git checkout [7-digit hash]
Example:
$ git checkout a2c4e6g
You'll be in a detached-head state, but no prob. Read this: Git create branch where detached HEAD is