相关疑难解决方法(0)

如何撤消Git中最近的提交?

我不小心将错误的文件提交给Git,但我还没有将提交推送到服务器.

如何从本地存储库中撤消这些提交?

git version-control undo pre-commit git-commit

2万
推荐指数
103
解决办法
826万
查看次数

撤消'git push'

这就是我在我所谓的稳定分支上所做的事情......

% git rebase master
First, rewinding head to replay your work on top of it...
Fast-forwarded alpha-0.3.0 to master.
% git status
# On branch alpha-0.3.0
# Your branch is ahead of 'origin/alpha-0.3.0' by 53 commits.
#
nothing to commit (working directory clean)
% git push
Fetching remote heads...
  refs/
  refs/heads/
  refs/tags/
  refs/remotes/
'refs/heads/master': up-to-date
updating 'refs/heads/alpha-0.3.0'
  from cc4b63bebb6e6dd04407f8788938244b78c50285
  to   83c9191dea88d146400853af5eb7555f252001b0
    done
'refs/heads/unstable': up-to-date
Updating remote server info
Run Code Online (Sandbox Code Playgroud)

这是我后来意识到的一个错误.我想撤消整个过程,并将alpha-0.3.0分支恢复到原来的状态.

我该怎么办?

git git-push

546
推荐指数
11
解决办法
57万
查看次数

标签 统计

git ×2

git-commit ×1

git-push ×1

pre-commit ×1

undo ×1

version-control ×1