git 将 master 重置为更旧的版本

git reset master to much older version

我正在尝试将我的 Git 主分支重置为更旧的版本。 我创建了一个分支来保存主分支的更改,然后进行了重置。 现在我被困住了,现在不知道该怎么办。状态消息告诉我可以快进分支,但我想提交更改以返回到旧版本。 Master 也已经被推送到 git 服务器。接下来我该做什么?

User MINGW64 application (feature/logBusiness)
$ git checkout master
M       .classpath
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

User MINGW64 application (master)
$ git checkout -b feature/v5.3.10
M       .classpath
Switched to a new branch 'feature/v5.3.10'

User MINGW64 application (feature/v5.3.10)
$ git push -u origin feature/v5.3.10
Enter passphrase for key '/c/Users/user/.ssh/id_rsa':
Total 0 (delta 0), reused 0 (delta 0)
To ssh://git@gitserver/srv/git/application
* [new branch]      feature/v5.3.10 -> feature/v5.3.10
Branch feature/v5.3.10 set up to track remote branch feature/v5.3.10 from origin.

User MINGW64 application (feature/v5.3.10)
$ git checkout master
M       .classpath
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.

User MINGW64 application (master)
$ git reset --hard RM2_5.3.8_alpha
HEAD is now at 2055fa8 Fixed bug when KPi has no database connection assigned

User MINGW64 application (master)
$ git status
On branch master
Your branch is behind 'origin/master' by 54 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
nothing to commit, working directory clean

要更新远程存储库,运行 git push -f 在本地 master 分支上。这将 覆盖 远程 master 分支,将其替换为您的本地版本。

这通常只是您应该在您是独占用户的分支上执行的操作。如果其他人正在共享远程 master 分支,像这样覆盖它将使他们难以合并基于 master 分支的旧值的任何更改。