---
title: "git回退到某个历史版本，并强制push"
author: "wangyanlong0107"
date: "2017-04-14T10:49:56Z"
tags: []
categories: ["开源软件"]
slug: "git-push"
draft: false
lastmod: "2017-04-14T10:49:56Z"
id: 2369094
url: "https://bigdragon.iteye.com/blog/2369094"
---

1\. 使用[Git](http://lib.csdn.net/base/git "Git知识库") log命令查看所有的历史版本，获取某个历史版本的id，假设查到历史版本的id是139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96。

2. 

 

**\[html]** [view plain](http://blog.csdn.net/newjueqi/article/details/49098123 "view plain") [copy](http://blog.csdn.net/newjueqi/article/details/49098123 "copy")

 

1. git reset --hard 139dcfaa558e3276b30b6b2e5cbbb9c00bbdca96

3\. 把修改推到远程服务器

 

 

**\[javascript]** [view plain](http://blog.csdn.net/newjueqi/article/details/49098123 "view plain") [copy](http://blog.csdn.net/newjueqi/article/details/49098123 "copy")

 

1. git push -f -u origin master