'commit'에 해당하는 글 1건

1. git checkout HEAD~{n번째 전}

(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>git checkout HEAD~1
Note: checking out 'HEAD~1'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 5ba51da little change
M       api/__pycache__/__init__.cpython-38.pyc
M       api/__pycache__/urls.cpython-38.pyc
# ...생략...

- 결과 : HEAD가 바로 이전 커밋으로 돌아갔음. 

- 확인 : 이전 커밋 해시번호 (5ba51da5)로 돌아갔음

2. 체크아웃했더니 서버로부터의 pull이 또 실패...ㅎㅎ => master로 다시 돌아오자...

(venv) C:\Users\user\PycharmProjects\DjangoProject\insta>git checkout master
Previous HEAD position was 5ba51da little change
Switched to branch 'master'
# ---생략----

Your branch and 'origin/master' have diverged,
and have 1 and 5 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

 

'Git > 개인' 카테고리의 다른 글

[Git 관리] user 변경하기  (0) 2020.11.10
[Git 관리] commit 취소하기  (0) 2020.11.02

WRITTEN BY
choco-songyi

,