ฉันได้ติดตามสถานะของต้นไม้ที่ใช้งานได้
$ git status foo/bar.txt
# On branch master
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#       deleted by us:      foo/bar.txt
#
no changes added to commit (use "git add" and/or "git commit -a")
มีไฟล์foo/bar.txtอยู่และฉันต้องการให้มันเป็น "ไม่เปลี่ยนแปลงสถานะ" อีกครั้ง (คล้ายกับ 'svn revert'):
$ git checkout HEAD foo/bar.txt
error: path 'foo/bar.txt' is unmerged
$ git reset HEAD foo/bar.txt
Unstaged changes after reset:
M       foo/bar.txt
ตอนนี้มันเริ่มสับสน
$ git status foo/bar.txt
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   foo/bar.txt
#
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   foo/bar.txt
#
ไฟล์เดียวกันในทั้งสองส่วนใหม่และแก้ไข? ฉันควรทำอย่างไรดี?
                
                7
              
                  ฉันหวังว่าใครบางคนสามารถอธิบายได้ว่าเราจะเข้าสู่สถานการณ์นี้ได้อย่างไรทำไมมันถึงเกิดขึ้นและทำไมการแก้ปัญหาถึงได้ผล
                
                
                  
                    —
                    Marcos Dione 
                    
                  
                
              
                  ฉันได้เข้าสู่สถานการณ์นี้เมื่อฉันโผล่ที่ซ่อนของฉันหลังจากที่ rebase ซึ่งทำให้ฉันมีความขัดแย้งในการรวม (ป๊อปที่ซ่อนไม่รวม) .... เพื่อแก้ไขมันฉันได้ "ชำระเงิน - พวกเขา" .... เห็นได้ชัดว่า การเปลี่ยนแปลงยังคงอยู่ที่นั่น .... เพื่อลบสิ่งเหล่านั้น .. ฉันลองเช็คเอาต์ไฟล์อีกครั้ง
                
                
                  
                    —
                    Arindam Roychowdhury