rollback to develop branch without last merge feature












0















I made a mistake merging my last feature with develop; I had just to finish my feature and then do a PR, and then merge trought github.



What is the right method to go back to before I merge my last feature ?



enter image description here



I'm confused about when do 'git push', and really with a PR , I don't must use anymore git finish feature, not ? because this last merge, and I need to do PR to pass circle tests.



can I delete my remote branch (because i have a local with the same name)? before do push? that is better? in case of conflicts with the remote?










share|improve this question




















  • 1





    From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

    – Tu.ma
    Nov 20 '18 at 10:35











  • but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

    – DDave
    Nov 20 '18 at 10:38











  • stackoverflow.com/questions/7099833/…

    – Tu.ma
    Nov 20 '18 at 10:41











  • thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

    – DDave
    Nov 20 '18 at 10:47






  • 2





    You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

    – Tu.ma
    Nov 20 '18 at 10:58
















0















I made a mistake merging my last feature with develop; I had just to finish my feature and then do a PR, and then merge trought github.



What is the right method to go back to before I merge my last feature ?



enter image description here



I'm confused about when do 'git push', and really with a PR , I don't must use anymore git finish feature, not ? because this last merge, and I need to do PR to pass circle tests.



can I delete my remote branch (because i have a local with the same name)? before do push? that is better? in case of conflicts with the remote?










share|improve this question




















  • 1





    From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

    – Tu.ma
    Nov 20 '18 at 10:35











  • but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

    – DDave
    Nov 20 '18 at 10:38











  • stackoverflow.com/questions/7099833/…

    – Tu.ma
    Nov 20 '18 at 10:41











  • thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

    – DDave
    Nov 20 '18 at 10:47






  • 2





    You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

    – Tu.ma
    Nov 20 '18 at 10:58














0












0








0








I made a mistake merging my last feature with develop; I had just to finish my feature and then do a PR, and then merge trought github.



What is the right method to go back to before I merge my last feature ?



enter image description here



I'm confused about when do 'git push', and really with a PR , I don't must use anymore git finish feature, not ? because this last merge, and I need to do PR to pass circle tests.



can I delete my remote branch (because i have a local with the same name)? before do push? that is better? in case of conflicts with the remote?










share|improve this question
















I made a mistake merging my last feature with develop; I had just to finish my feature and then do a PR, and then merge trought github.



What is the right method to go back to before I merge my last feature ?



enter image description here



I'm confused about when do 'git push', and really with a PR , I don't must use anymore git finish feature, not ? because this last merge, and I need to do PR to pass circle tests.



can I delete my remote branch (because i have a local with the same name)? before do push? that is better? in case of conflicts with the remote?







git






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 10:47







DDave

















asked Nov 20 '18 at 10:33









DDaveDDave

390315




390315








  • 1





    From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

    – Tu.ma
    Nov 20 '18 at 10:35











  • but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

    – DDave
    Nov 20 '18 at 10:38











  • stackoverflow.com/questions/7099833/…

    – Tu.ma
    Nov 20 '18 at 10:41











  • thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

    – DDave
    Nov 20 '18 at 10:47






  • 2





    You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

    – Tu.ma
    Nov 20 '18 at 10:58














  • 1





    From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

    – Tu.ma
    Nov 20 '18 at 10:35











  • but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

    – DDave
    Nov 20 '18 at 10:38











  • stackoverflow.com/questions/7099833/…

    – Tu.ma
    Nov 20 '18 at 10:41











  • thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

    – DDave
    Nov 20 '18 at 10:47






  • 2





    You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

    – Tu.ma
    Nov 20 '18 at 10:58








1




1





From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

– Tu.ma
Nov 20 '18 at 10:35





From GitHub, go to your PR and scroll down. There should be a "Revert" button. If you are working in collaboration with other users on the develop branch, it's the safer solution.

– Tu.ma
Nov 20 '18 at 10:35













but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

– DDave
Nov 20 '18 at 10:38





but i had no PR; that is the problem.. I merged it directly, so need rollback to do a PR and not a finish feature that merge without pr

– DDave
Nov 20 '18 at 10:38













stackoverflow.com/questions/7099833/…

– Tu.ma
Nov 20 '18 at 10:41





stackoverflow.com/questions/7099833/…

– Tu.ma
Nov 20 '18 at 10:41













thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

– DDave
Nov 20 '18 at 10:47





thanks but? i use gitflow, so my branch is develop; i dont want to do mistakes with master

– DDave
Nov 20 '18 at 10:47




2




2





You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

– Tu.ma
Nov 20 '18 at 10:58





You should try and read through the answer. What you have to do is going in the develop branch and revert the commit. The revert will create a new commit that reverts all the changes. Now you have a clean deployment branch, and you can go back to your feature branch.

– Tu.ma
Nov 20 '18 at 10:58












1 Answer
1






active

oldest

votes


















0














These are non-github solutions that can undo code changes from merge, which can be done in terminal(assuming you've checked out develop branch):





  1. git revert develop -m 2 and then git push.



    git revert develop -m 2: git revert means you're going to create a revert commit, and develop means your revert target is where your develop branch is pointing to, and -m 2 means you're reverting a merge commit and you intend to revert change from second parent of merge.




  2. git reset develop^1 --hard, and then git reset origin/develop --mixed, and then git commit(with messages like "Revert merge.")



    git reset develop^1 --hard means you're resetting HEAD & filesystem status to first parent of develop. So after this, your filesystem should not include changes from develop branch.



    git reset origin/develop --mixed means you're resetting HEAD into origin/develop, but preserve filesystem changes and add all into staged area. So after this, your filesystem should be exactly same to what it was before merge, and ready to commit.








share|improve this answer
























  • thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

    – DDave
    Nov 20 '18 at 11:13






  • 1





    It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

    – evolutionxbox
    Nov 20 '18 at 11:41











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391057%2frollback-to-develop-branch-without-last-merge-feature%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














These are non-github solutions that can undo code changes from merge, which can be done in terminal(assuming you've checked out develop branch):





  1. git revert develop -m 2 and then git push.



    git revert develop -m 2: git revert means you're going to create a revert commit, and develop means your revert target is where your develop branch is pointing to, and -m 2 means you're reverting a merge commit and you intend to revert change from second parent of merge.




  2. git reset develop^1 --hard, and then git reset origin/develop --mixed, and then git commit(with messages like "Revert merge.")



    git reset develop^1 --hard means you're resetting HEAD & filesystem status to first parent of develop. So after this, your filesystem should not include changes from develop branch.



    git reset origin/develop --mixed means you're resetting HEAD into origin/develop, but preserve filesystem changes and add all into staged area. So after this, your filesystem should be exactly same to what it was before merge, and ready to commit.








share|improve this answer
























  • thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

    – DDave
    Nov 20 '18 at 11:13






  • 1





    It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

    – evolutionxbox
    Nov 20 '18 at 11:41
















0














These are non-github solutions that can undo code changes from merge, which can be done in terminal(assuming you've checked out develop branch):





  1. git revert develop -m 2 and then git push.



    git revert develop -m 2: git revert means you're going to create a revert commit, and develop means your revert target is where your develop branch is pointing to, and -m 2 means you're reverting a merge commit and you intend to revert change from second parent of merge.




  2. git reset develop^1 --hard, and then git reset origin/develop --mixed, and then git commit(with messages like "Revert merge.")



    git reset develop^1 --hard means you're resetting HEAD & filesystem status to first parent of develop. So after this, your filesystem should not include changes from develop branch.



    git reset origin/develop --mixed means you're resetting HEAD into origin/develop, but preserve filesystem changes and add all into staged area. So after this, your filesystem should be exactly same to what it was before merge, and ready to commit.








share|improve this answer
























  • thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

    – DDave
    Nov 20 '18 at 11:13






  • 1





    It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

    – evolutionxbox
    Nov 20 '18 at 11:41














0












0








0







These are non-github solutions that can undo code changes from merge, which can be done in terminal(assuming you've checked out develop branch):





  1. git revert develop -m 2 and then git push.



    git revert develop -m 2: git revert means you're going to create a revert commit, and develop means your revert target is where your develop branch is pointing to, and -m 2 means you're reverting a merge commit and you intend to revert change from second parent of merge.




  2. git reset develop^1 --hard, and then git reset origin/develop --mixed, and then git commit(with messages like "Revert merge.")



    git reset develop^1 --hard means you're resetting HEAD & filesystem status to first parent of develop. So after this, your filesystem should not include changes from develop branch.



    git reset origin/develop --mixed means you're resetting HEAD into origin/develop, but preserve filesystem changes and add all into staged area. So after this, your filesystem should be exactly same to what it was before merge, and ready to commit.








share|improve this answer













These are non-github solutions that can undo code changes from merge, which can be done in terminal(assuming you've checked out develop branch):





  1. git revert develop -m 2 and then git push.



    git revert develop -m 2: git revert means you're going to create a revert commit, and develop means your revert target is where your develop branch is pointing to, and -m 2 means you're reverting a merge commit and you intend to revert change from second parent of merge.




  2. git reset develop^1 --hard, and then git reset origin/develop --mixed, and then git commit(with messages like "Revert merge.")



    git reset develop^1 --hard means you're resetting HEAD & filesystem status to first parent of develop. So after this, your filesystem should not include changes from develop branch.



    git reset origin/develop --mixed means you're resetting HEAD into origin/develop, but preserve filesystem changes and add all into staged area. So after this, your filesystem should be exactly same to what it was before merge, and ready to commit.









share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 11:04









ik1neik1ne

10016




10016













  • thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

    – DDave
    Nov 20 '18 at 11:13






  • 1





    It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

    – evolutionxbox
    Nov 20 '18 at 11:41



















  • thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

    – DDave
    Nov 20 '18 at 11:13






  • 1





    It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

    – evolutionxbox
    Nov 20 '18 at 11:41

















thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

– DDave
Nov 20 '18 at 11:13





thanks but too late, i do a git reset --hard ae350e29e3d9aa194aa51f10befd677f0066f34f , and git push origin $(git_current_branch) -f , and now i've lost i think all the right develop branch, because ae350e29e3d9aa194aa51f10befd677f0066f34f it's a commit that i did not push ! git is really crazy

– DDave
Nov 20 '18 at 11:13




1




1





It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

– evolutionxbox
Nov 20 '18 at 11:41





It’s because git doesn’t like removing changes. It’d much rather add additional commits which remove code.

– evolutionxbox
Nov 20 '18 at 11:41


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53391057%2frollback-to-develop-branch-without-last-merge-feature%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

SQL update select statement

WPF add header to Image with URL pettitions [duplicate]