說我編輯的文件如何使用更改恢復暫存文件,保存更改時間?
echo "hi" > someVersionedFile.txt
//Then I staged the file
git add .
git status
<console reads>
Changes to be committed
new file: someVersionedFile.txt
現在我對這些文件
echo "hi again file" >> someVersionedFile.txt
//Then I restage the file with these changes
git add .
git status
<console reads>
Changed but not commited
modified file: someVersionedFile.txt
問題的更多變化:我怎麼回覆最後上演的版本?這是否可以做,因爲它沒有承諾?
我很確定這是不可能的,但我也想知道它是不是! –
不知道你是如何做到這一點的,但是如果你現在提交,只會進行階段性更改。然後,您可以將該文件恢復到剛剛創建的提交。 – andypaxo
@andypaxo這不是問題。更爲嚴密的問題是,如果你在變化的情況下展示一個文件,對它進行更多的更改,那麼如何將文件恢復到上演階段 - 考慮到階段文件是否存在其他更改? – stackoverflow