holms
holms

Reputation: 9560

how to revert changes only for one file with git-svn?

I've corrupted one file and I'd like to revert it back. My project is using git-svn. So how can I revert this one particular file? Or even better if I could view whole change set of this file.

Detailed steps would be appreciated.

Upvotes: 0

Views: 779

Answers (1)

rcomblen
rcomblen

Reputation: 4649

git revert SHA1_OF_FAULTY_COMMIT

add back the changes but don't commit

git cherry-pick -n SHA1_OF_FAULTY_COMMIT

Modify what needs to be modified, e.g.

git reset HEAD file_that_should_not_have_been_modified

Commit

git commit -m "to_be_merged"

Squash the two commits, put a meaningful comment.

git rebase -i HEAD~2

Review your changes, it should only contains the modification on the single file you:

git show

You can now push that to svn

git svn dcommit

Upvotes: 1

Related Questions