How to stash my previous commit?

前端 未结 5 1768
感动是毒
感动是毒 2021-01-30 08:29

I\'ve got the following situation on my git log:

commit 111  <-- need to push it to the repository

commit 222  <-- need to stash this one

..         


        
5条回答
  •  灰色年华
    2021-01-30 08:51

    It's works for me;

    1. Checkout on commit that is a origin of current branch.
    2. Create new branch from this commit.
    3. Checkout to new branch.
    4. Merge branch with code for stash in new branch.
    5. Make soft reset in new branch.
    6. Stash your target code.
    7. Remove new branch.

    I recommend use something like a SourceTree for this.

提交回复
热议问题