If you want to use the changes in the commits after, yes. If you don't need
these commits anymore, you can just use "git reset --hard origin/master"
and all your commits that you haven't pushed yet will be "almost" lost.


William Seiti Mizuta
@williammizuta
Caelum | Ensino e Inovação
www.caelum.com.br


On Wed, Oct 30, 2013 at 3:39 PM, Eric Fowler <eric.fow...@gmail.com> wrote:

> Given that I have already made a commit of my new changes in master (but
> not a push), is this still the way to go?
>
> Eric
>
>
>  On Tue, Oct 29, 2013 at 4:43 PM, William Seiti Mizuta <
> william.miz...@gmail.com> wrote:
>
>>  Hi Eric,
>>
>> to not lose your changes, you can create a branch which represents your
>> current state of your repository. For this, just create a branch with "git
>> branch fallback" command. It will be a copy of your current branch, so run
>> this command when you are at master branch.
>>
>> Then, you can return to your remote master state with "git reset --hard
>> origin/master". When you want to recover the modifications, just merge the
>> content of fallback branch: "git merge fallback".
>>
>>
>> William Seiti Mizuta
>> @williammizuta
>> Caelum | Ensino e Inovação
>> www.caelum.com.br
>>
>>
>> On Tue, Oct 29, 2013 at 9:07 PM, Eric Fowler <eric.fow...@gmail.com>wrote:
>>
>>> I did a commit and push into master a while back. I stayed in master and
>>> made some changes, which I have committed but not pushed.
>>>
>>> I want to store the changes but revert my working code to the code I
>>> last pushed (for some regression testing), without permanently discarding
>>> the new changes.
>>>
>>> How can I do this?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Git for human beings" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to git-users+unsubscr...@googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Git for human beings" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/git-users/xwpB4rnT2Kg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> git-users+unsubscr...@googlegroups.com.
>>
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
> --
> cc:NSA
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to