我丢了提交吗?

时间:2018-03-06 22:31:52

标签: git github

在我的代码发生一些变化后,我注意到我需要在新分支中推送此更改,所以我这样做:

$ git checkout develop
error: Your local changes to the following files would be overwritten by checkout
Please commit your changes or stash them before you switch branches.
Aborting

$ git commit -m "Update code to follow pep8 style"
[hotfix/tests 4aadaf0] Update code to follow pep8 style
54 files changed, 455 insertions(+), 331 deletions(-)

$ git checkout develop 
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.

$ git checkout -b feature/pep8-code-style
Switched to a new branch 'feature/pep8-code-style'

$ git push origin feature/pep8-code-style 
Total 0 (delta 0), reused 0 (delta 0)

我丢失了我的代码。它在哪里?

1 个答案:

答案 0 :(得分:3)

您的更改和提交仍应保留在hotfix/tests分支上。什么都没有丢失:

[hotfix/tests 4aadaf0] Update code to follow pep8 style

因此,提交4aadaf0包含您的pep8样式更改。

相关问题