D
D
Danya Kozlovskiy2021-05-21 17:05:26
git
Danya Kozlovskiy, 2021-05-21 17:05:26

How to revert to master branch after push?

Hello, I cloned the master branch, made changes, committed and pushed it to a new branch. How to switch back to the master branch, while having the repository take the state of this branch, so that you can then do the same actions without breaking anything?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Aksenov, 2021-05-21
@morto

1. Switch to master:
$ git checkout master
2. Or immediately merge the changes to the master branch:

$ git checkout master
$ git merge <имя ветки, в которой были изменения>

PS $- do not copy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question