2014-01-06 4 views
1

일부 파일에서 git add을 실행하여 논리적으로 변경된 집합을 구성하고 다른 변경 사항을 적용한 후 git add -p을 사용하여 다른 논리적 변경 집합을 추출했습니다. 반쯤에, 나는 이전 세트를 저지른 것이 아니라는 것을 알았다.git add -p를 취소하는 방법 변경 사항을 삭제 하시겠습니까?

Stage this hunk [y,n,q,a,d,/,s,e,?]? ? 
y - stage this hunk 
n - do not stage this hunk 
q - quit; do not stage this hunk nor any of the remaining ones 
a - stage this hunk and all later hunks in the file 
d - do not stage this hunk nor any of the later hunks in the file 
g - select a hunk to go to 
/- search for a hunk matching the given regex 
j - leave this hunk undecided, see next undecided hunk 
J - leave this hunk undecided, see next hunk 
k - leave this hunk undecided, see previous undecided hunk 
K - leave this hunk undecided, see previous hunk 
s - split the current hunk into smaller hunks 
e - manually edit the current hunk 
? - print help 

은 어떻게 추가 패치를 재설정 할 수 있습니다

git add -p의 상호 작용 도움은 다음과 같은 옵션을 제공합니다?

답변

3

git add -p 단계는 변경 사항을 되돌릴 때 사용할 수있는 기록을 저장하지 않고 변경됩니다. 그러나 변경 내용을 취소하려면 git reset -p 또는 git reset --patch을 사용할 수 있습니다.

  • q
    실수로 추가 된 모든 변경 사항을 재설정 대화 형 git add -p
  • git reset -p
    를 종료합니다
  • git commit
    첫 번째 변경 집합을 커밋하려면 다음 절차는 다음과 같은 뭔가 선을 보일 것이다
  • git add -p
    다시, addi 제 커밋 잉
  • git commit
    커밋 커밋 새로운 초로 변경
관련 문제