git에서 코드를 잘못 제출했습니다.

9482 단어

git에서 코드를 잘못 제출했습니다.


참고 자료


git는 기능 개발을 잘못했습니다. Git에서 모든 조작과log,reflog,cherry-pick를 어떻게 취소하고 사용합니까?

단계

  • git checkout은 코드를 제출하지 않고 코드의 지점을 제출했습니다
  • git reset 모 제출 해시 값(git reset HEAD~1 최근 제출은 임시 저장소로 되돌려주고 이번 제출을 취소함)
  • git add . 파일을 임시 저장소로 제출
  • git stash(임시로 저장한 파일을git의 임시 창고에 제출)
  • git checkout 이 제출 코드의 지점
  • git stash pop
  • 코드를 정상적으로 제출하면 됩니다
  • jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug|REVERTING)
    $ git log --graph
    * commit bd38a09b2c1983eba834330db524b69dbd397d37 (HEAD -> pc_bug)
    | Author: xiechangzhou 
    | Date:   Fri Feb 14 09:54:09 2020 +0800
    |
    |                   pc           
    |
    * commit 4b568e086019bcd93e27e490b4b94d588d17b7fc
    | Author: xiechangzhou 
    | Date:   Thu Feb 13 21:41:45 2020 +0800
    |
    |       pc              xml
    |
    * commit f8cea85a01e66a2e47c29245ed9677d8f48fe4bb
    | Author: xiechangzhou 
    | Date:   Thu Feb 13 21:32:15 2020 +0800
    |
    |       pc           
    |
    *   commit 8d268344dc113b74f2b669b32f871a9c3f8195b0 (origin/pc_bug, pc_waiter)
    |\  Merge: 7bac039 c65bff6
    | | Author: zhaomeng <62672000>
    | | Date:   Thu Feb 6 21:05:17 2020 +0800
    | |
    | |     Merge branch 'pc_bug' of http://114.215.104.72:8888/weiyu/handordering into pc_bug
    | |
    | *   commit c65bff626cc37f89798390e142e0098a48024e65
    | |\  Merge: 8296c3d b147bab
    | | | Author: zhanglan 
    | | | Date:   Thu Feb 6 20:29:25 2020 +0800
    | | |
    | | |     Merge remote-tracking branch 'origin/pc_bug' into pc_bug
    | | |
    | | * commit b147bab58a606a912db89fc23fbb4fd4dd7422d0
    | | | Author: xiechangzhou 
    | | | Date:   Thu Feb 6 20:25:46 2020 +0800
    | | |
    | | |                   
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug|REVERTING)
    $ git branch -a
      master
    * pc_bug
      pc_waiter
      produce
      remotes/origin/HEAD -> origin/master
      remotes/origin/master
      remotes/origin/pc_bug
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug|REVERTING)
    $ git reset 8d268344dc11
    Unstaged changes after reset:
    M       src/main/java/com/zichen/pc/util/TableUtil.java
    M       src/main/java/com/zichen/xhkq/dao/order/OrderStatisticsDao.java
    M       src/main/java/com/zichen/xhkq/dict/publicflag/Dict_tabel.java
    M       src/main/java/com/zichen/xhkq/mapping/ordermanage/OrderStatisticsMapping.xml
    M       src/main/java/com/zichen/xhkq/service/order/OrderStatisticsService.java
    M       src/main/java/com/zichen/xhkq/vo/DailySettlementByMinutesVO.java
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug)
    $ git status
    On branch pc_bug
    Your branch is up-to-date with 'origin/pc_bug'.
    Changes not staged for commit:
      (use "git add ..." to update what will be committed)
      (use "git checkout -- ..." to discard changes in working directory)
    
            modified:   src/main/java/com/zichen/pc/util/TableUtil.java
            modified:   src/main/java/com/zichen/xhkq/dao/order/OrderStatisticsDao.java
            modified:   src/main/java/com/zichen/xhkq/dict/publicflag/Dict_tabel.java
            modified:   src/main/java/com/zichen/xhkq/mapping/ordermanage/OrderStatisticsMapping.xml
            modified:   src/main/java/com/zichen/xhkq/service/order/OrderStatisticsService.java
            modified:   src/main/java/com/zichen/xhkq/vo/DailySettlementByMinutesVO.java
    
    Untracked files:
      (use "git add ..." to include in what will be committed)
    
            src/main/java/com/zichen/pc/model/bo/TableName.java
            src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
            src/test/myTest/pc/
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug)
    $ git stash
    Saved working directory and index state WIP on pc_bug: 8d26834 Merge branch 'pc_bug' of http://114.215.104.72:8888/weiyu/handordering into pc_bug
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug)
    $ git status
    On branch pc_bug
    Your branch is up-to-date with 'origin/pc_bug'.
    Untracked files:
      (use "git add ..." to include in what will be committed)
    
            src/main/java/com/zichen/pc/model/bo/TableName.java
            src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
            src/test/myTest/pc/
    
    nothing added to commit but untracked files present (use "git add" to track)
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_bug)
    $ git checkout pc_waiter
    Switched to branch 'pc_waiter'
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git stash pop
    On branch pc_waiter
    Changes not staged for commit:
      (use "git add ..." to update what will be committed)
      (use "git checkout -- ..." to discard changes in working directory)
    
            modified:   src/main/java/com/zichen/pc/util/TableUtil.java
            modified:   src/main/java/com/zichen/xhkq/dao/order/OrderStatisticsDao.java
            modified:   src/main/java/com/zichen/xhkq/dict/publicflag/Dict_tabel.java
            modified:   src/main/java/com/zichen/xhkq/mapping/ordermanage/OrderStatisticsMapping.xml
            modified:   src/main/java/com/zichen/xhkq/service/order/OrderStatisticsService.java
            modified:   src/main/java/com/zichen/xhkq/vo/DailySettlementByMinutesVO.java
    
    Untracked files:
      (use "git add ..." to include in what will be committed)
    
            src/main/java/com/zichen/pc/model/bo/TableName.java
            src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
            src/test/myTest/pc/
    
    no changes added to commit (use "git add" and/or "git commit -a")
    Dropped refs/stash@{0} (d0f16b65f101073cdada906e4c3100d4e28aa178)
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git branch -a
      master
      pc_bug
    * pc_waiter
      produce
      remotes/origin/HEAD -> origin/master
      remotes/origin/master
      remotes/origin/pc_bug
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git status
    On branch pc_waiter
    Changes not staged for commit:
      (use "git add ..." to update what will be committed)
      (use "git checkout -- ..." to discard changes in working directory)
    
            modified:   src/main/java/com/zichen/pc/util/TableUtil.java
            modified:   src/main/java/com/zichen/xhkq/dao/order/OrderStatisticsDao.java
            modified:   src/main/java/com/zichen/xhkq/dict/publicflag/Dict_tabel.java
            modified:   src/main/java/com/zichen/xhkq/mapping/ordermanage/OrderStatisticsMapping.xml
            modified:   src/main/java/com/zichen/xhkq/service/order/OrderStatisticsService.java
            modified:   src/main/java/com/zichen/xhkq/vo/DailySettlementByMinutesVO.java
    
    Untracked files:
      (use "git add ..." to include in what will be committed)
    
            src/main/java/com/zichen/pc/model/bo/TableName.java
            src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
            src/test/myTest/pc/
    
    no changes added to commit (use "git add" and/or "git commit -a")
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git add .
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git status
    On branch pc_waiter
    Changes to be committed:
      (use "git reset HEAD ..." to unstage)
    
            new file:   src/main/java/com/zichen/pc/model/bo/TableName.java
            new file:   src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
            modified:   src/main/java/com/zichen/pc/util/TableUtil.java
            modified:   src/main/java/com/zichen/xhkq/dao/order/OrderStatisticsDao.java
            modified:   src/main/java/com/zichen/xhkq/dict/publicflag/Dict_tabel.java
            modified:   src/main/java/com/zichen/xhkq/mapping/ordermanage/OrderStatisticsMapping.xml
            modified:   src/main/java/com/zichen/xhkq/service/order/OrderStatisticsService.java
            modified:   src/main/java/com/zichen/xhkq/vo/DailySettlementByMinutesVO.java
            new file:   src/test/myTest/pc/WaiterTest.java
    
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git commit -m      
    [pc_waiter 973d690]      
     9 files changed, 305 insertions(+), 20 deletions(-)
     create mode 100644 src/main/java/com/zichen/pc/model/bo/TableName.java
     create mode 100644 src/main/java/com/zichen/pc/model/vo/WaiterPerformanceVO.java
     create mode 100644 src/test/myTest/pc/WaiterTest.java
    
    jie@mozq MINGW64 /d/00/mozq_pro1/handordering2 (pc_waiter)
    $ git log --graph --all
    * commit 973d6903c1a165b91fe549f9d20756274ba30e56 (HEAD -> pc_waiter)
    | Author: xiechangzhou 
    | Date:   Tue Feb 18 11:48:50 2020 +0800
    |
    |          
    |
    *   commit 8d268344dc113b74f2b669b32f871a9c3f8195b0 (origin/pc_bug, pc_bug)
    |\  Merge: 7bac039 c65bff6
    | | Author: zhaomeng <62672000>
    | | Date:   Thu Feb 6 21:05:17 2020 +0800
    | |
    | |     Merge branch 'pc_bug' of http://114.215.104.72:8888/weiyu/handordering into pc_bug
    | |
    | *   commit c65bff626cc37f89798390e142e0098a48024e65
    | |\  Merge: 8296c3d b147bab
    | | | Author: zhanglan 
    | | | Date:   Thu Feb 6 20:29:25 2020 +0800
    | | |
    | | |     Merge remote-tracking branch 'origin/pc_bug' into pc_bug
    | | |
    | | * commit b147bab58a606a912db89fc23fbb4fd4dd7422d0
    | | | Author: xiechangzhou 
    | | | Date:   Thu Feb 6 20:25:46 2020 +0800
    | | |
    | | |                   

    좋은 웹페이지 즐겨찾기