When I pull another branch to the branch that I am operating locally, I can no longer switch branches.I want to return to the previous state of pull.

Asked 2 years ago, Updated 2 years ago, 130 views

I am working on branch A locally, but if I accidentally pull the master branch for this branch, there will be a conflict and I cannot switch to another branch.Local branch A has been pushed remotely once before.

pull "pull from source" of VSCode.

If you are currently trying to switch to another branch locally, the following message appears:

Git:you need to resolve your current index first

I'd like to return it to the remote branch A state (I want to return it to the state before I pull it), but

  • git reset --head HEAD
  • git merge --abort

Which of the following commands should I hit?

[git] 4 ways to merge but quit - Qiita

I also referred to this article, but at the end, I was a little worried because it said, "You should never push and cancel a commit that is open to other developers."

By the way, I only touched this brunch myself.

If you know, please reply.

git gitlab

2022-09-30 19:37

1 Answers

Self-Solving

git merge --abort

Resolved in !


2022-09-30 19:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.