0

In Xcode we pulled someone else's push and merged with local copy. However now the pulled copy has corrupted storyboard. The worst thing is we accidentally pushed those corrupted file to remote repo. Now is there any way I can solve this issue?

we are using SourceTree as our interface to Git.

One of our member has the last working copy as we haven't pulled any corrupted data from server to his copy.

Any potential solution for this situation? Thanks

TeaCupApp
  • 11,316
  • 18
  • 70
  • 150

2 Answers2

2

Sorry but I'm not enough of a Git expert be be able to give you the exact commands, but there are git commands you can enter to revert a file to a specific revision/commit. If you hunt around the web you should be able to find them and revert the file.

You may have to use command line Git.

This may help Reset or revert a specific file to a specific revision using Git? and this Rollback file to much earlier version using Git

Community
  • 1
  • 1
drekka
  • 20,957
  • 14
  • 79
  • 135
  • Thanks I ended up copy and paste one of our working copy and re push it to server...so with minor loss we are back on track :) – TeaCupApp Feb 07 '12 at 20:38
  • @Wayne Hartman's comment above about project files and xibs is a good point. It is possible to hand merge changes to a project file, but not recommended. I've encountered a similar thing with IBM WebSphere tooling. The core of the problem is that the file is XML (which is mergable) but contains unique keys and ids used by the tools, which can be an issue if you don't know how the XML is structured. – drekka Feb 07 '12 at 23:06
0

A pull and merge is commited to the history like any other change so you just need to undo that commit. The git command to delete the last commit and restore your working tree to the previous commit is:

git reset --hard HEAD~1

(from Delete commits from a branch in Git)

This change could then be pushed back up to your server.

Community
  • 1
  • 1
insysion
  • 301
  • 2
  • 9