1. 특정 브랜치만 클론하기[1]

$ git clone -b <branch> <repository url>

 

2. git add 이전으로 되돌리기[2]

(특정 파일만)

$ git reset <file>

(전체)

$ git reset

 

3. git commit 이전으로 되돌리기[3](마지막 커밋에서 이전 커밋으로)

(마지막 커밋지점에서 앞으로 한단계)

$ git reset --soft HEAD~1

(마지막 커밋지점에서 앞으로 두단계)

$ git reset --soft HEAD~2

 

참고자료

1. How To Clone a Git Repository, Available online: devconnected.com/how-to-clone-a-git-repository/#:~:text=In%20order%20to%20clone%20a%20specific%20branch%2C%20you%20have%20to,branch%20you%20want%20to%20clone.&text=%24%20git%20clone%20%2Db%20dev%20https,Enumerating%20objects%3A%20813%2C%20done 29 Jan 2021.

2. How To Undo Last Git Commit, Available online: devconnected.com/how-to-undo-last-git-commit/#:~:text=The%20easiest%20way%20to%20undo,removed%20from%20your%20Git%20history 29 Jan 2021.

3. How to Undo a Git Add, Available online: www.freecodecamp.org/news/how-to-undo-a-git-add/#:~:text=To%20undo%20git%20add%20before,reset%20to%20unstage%20all%20changes 29 Jan 2021.

+ Recent posts