git 回滚版本

Posted by wxianfeng Sun, 21 Aug 2011 04:28:00 GMT

git 版本出错了,如何回滚到之前某一个版本,思路是本地回滚到之前某个版本,然后把远程分支删除,然后以本地的回滚版本重新建立分支

# 新建old_master分支做备份   
>git branch old_master   

# push到远程   
>git push origin old_master:old_master   

# 本地仓库回退到某个版本   
>git reset --hard baeertasdasdvf

# 删除远程的master分支   
>git push origin :master   

# 重新创建master分支   
>git push origin master  

# 重新clone代码
>git clone git@192.168.10.201:xxx.git

This entry was posted on Sun, 21 Aug 2011 04:28:00 GMT and Posted in . You can follow any any response to this entry through the Atom feed. You can leave a comment or a trackback from your own site.

Tags ,


Trackbacks

Use the following link to trackback from your own site:
http://blog.wxianfeng.com/trackbacks?article_id=213

Comments

  1. Avatar
    passenger Ships bari Patras over {{count}} years ago:

    Thanks for the gopod writeup. It in reality was a amusement account it.
    Look complicated to far added agreeable from you!
    By the way, how could we keep up a correspondence?

  2. Avatar
    greece ferry over {{count}} years ago:

    Hello, i read your blog occasionally and i owwn a similar onee and
    i was just curious if you get a lot of spam feedback? If so
    how do you preven it, any plugin or anything you can advise?
    I get so much lately it’s driiving me crazy so any assistance is
    very much appreciated.

  3. Avatar
    miniurl.x10.mx over {{count}} years ago:

    Admiring the hard wok you put into your site and detailed information you
    present. It’s awesome to come across a blog every once in a
    while that isn’t the same outdated rehashed material.
    Fantastic read! I’ve bookmarked your site and I’m adding
    your RSS feeds to my Google account.

  4. Avatar
    miniurl.x10.mx over {{count}} years ago:

    Admiring the hard work you put into your site and detailed
    information you present. It’s awesome to
    come across a blog every once in a while that isn’t the
    same outdated rehashed material. Fantastic read! I’ve bookmarked your sikte and I’m adding your
    RSS feeds to my Google account.

  5. Avatar
    Italy - Greece about {{count}} years ago:

    I like it whenever people come together and share views.
    Great blog, kkeep it up!

  6. Avatar
    content over {{count}} years ago:

    Are you a Weeds fan? The most searched for episode
    that people are looking for is Weeds. This post is written in hopes
    of exposing exactly how to see Weeds with Satellite TV for PC.

    The terrific information is that with today’s technology it is now possible for anyone to watch any one of the episodes they like
    online from the convenience of the their home.

    Not knowledgeable about Weeds

  7. Avatar
    content over {{count}} years ago:

    Are you a Weeds fan? The most searched for episode that people
    are looking for is Weeds. This post is written in hopes of exposing exactly how to see Weeds with Satellite TV for PC.
    The terrific information is that with today’s technology it is
    now possible for anyone to watch any one of the episodes they like online from
    the convenience of the their home.

    Not knowledgeable about Weeds

  8. Avatar
    bettasecrets.top over {{count}} years ago:

    For essentially the most part, it’s a good idea to keep
    male bettas separate. They will battle each other every chance they are
    able to if they are together. This is also true for betta fish of opposing sexes.
    Unless you happen to be breeding betta fish.

  9. Avatar
    bettasecrets.top over {{count}} years ago:

    For essentially the most part, it’s a good idea to keep male bettas separate.
    They will battle each other every chance they are able to if
    they are together. This is also true for betta fish of opposing sexes.
    Unless you happen to be breeding betta fish.

  10. Avatar
    shipping betta fish to U.S.A. over {{count}} years ago:

    Bettas can be a special type of fish termed as a labyrinth fish.
    They are typically aggressive fish, and were instructed to fight
    each other for lots of yearsbrutal actions have earned them the
    title Siamese fighting fish.

  11. Avatar
    shipping betta fish to U.S.A. over {{count}} years ago:

    Bettas can be a special type of fish termed as a labyrinth fish.

    They are typically aggressive fish, and were instructed
    to fight each other for lots of yearsbrutal
    actions have earned them the title Siamese fighting fish.

Leave a comment