如何将本地分支内容覆盖到本地和远程开发分支?

时间:2016-06-20 08:54:58

标签: git github version-control merge

我们是开发人员团队,使用git进行版本控制系统。我向本地分支添加了一些更改并将其推送到我的本地和远程development分支。 另一位开发人员在将其内容合并到远程开发时发现了我的更改。但是错误地我的更改被这位开发人员删除了,他将更改推送到远程development分支。

当我将远程更改合并到我的本地development分支时,我丢失了我添加的文件,该文件已由其他开发人员删除。

当我删除了更改后,我已将我的分支重置为提交。重置后,我发现了更改,但我无法将其推送或合并到我的development分支。我不想重置master分支。

请帮助,我该怎么做才能覆盖我对本地和远程开发分支的本地更改,以便再次添加我丢失的文件。

1 个答案:

答案 0 :(得分:0)

git reflog可以为您提供帮助。

您的朋友应该使用development在他的计算机上检索他的reflog分支的状态,然后才能使用reflog

checkout菜单中,对于每个州,都会有相关的提交哈希值。他应development-copy使用development分支状态的哈希值git push -f成为development git log之前的development-copy新分支development 。现在,他应该查看apply上的function create_question(question, callback){ var form = new FormData() var settings = { "url": "http://127.0.0.1:8000/" + "question/api/create_question/", "method": "POST", "headers": { 'Content-Type': undefined }, "processData": false, "data": form } $cordovaFile.readAsDataURL(cordova.file.dataDirectory, question.name) .then(function (success) { form.append("file", success) form.append("title", question.title) form.append("options", JSON.stringify(question.options)) form.append("correct_option", question.correct_option) form.append("question_id", question.question_id) form.append("project_id", question.project_id) $http(settings).then(function (response) { if (response.data.hasOwnProperty("date_str")) { callback(true, response.data) console.log("succesFull") } else { console.log(JSON.stringify(response.data)) callback(false, response.data) } }, function (response) { console.log(Utf8Decode(response.data)) callback(false, response.data) }); // success }, function (error) { callback(false,error) // error }); } ,并在他想要添加到@parser_classes((MultiPartParser, )) class CreateQuestion(APIView): def post(self, request, format=None): picture = request.data['file'] question_id = request.data['question_id'] project_id = request.data['project_id'] options = request.data['options'] title = request.data['title'] correct_option = request.data['correct_option'] username = request.user.username project = Project.objects.get(project_id=project_id) if project.owner_user.username == username: ext = '.jpg' aws = AWSClient() picture_name = question_id + ext picture_url = aws.put(picture, 'question_pictures', picture_name) question = Question.objects.create(question_id=question_id, title=title, picture_url=picture_url, options=options, owner_project=project, correct_option=correct_option) project.question_count += 1 project.picture_url = picture_url project.save() serializer = QuestionSerializer(question, context={"request": request}) return JsonResponse(serializer.data) else: return JsonResponse({"result": "fail"}) 的所有提交中创建一个补丁,然后将补丁发送到您的计算机,你可以public boolean add(E element) { if(root==null){ } else { while(true){ if(comp<0){ } else if (temp.right!=null) temp=temp.right; else temp.right=new Entry<E> (element,temp); size++; return true; } } } 补丁。

相关问题