你好,我真的有一個奇怪的問題。刪除源文件GitHub合併NetBeams
我對所有這些GitHub的東西都很陌生,所以我嘗試了一些東西。 基本上發生的事情是,我在Netbeams中有一個項目,並想在我的GitHub上發佈它。所以我在Github上創建了存儲庫,並想向它添加文件。
因此,我進入了Netbeams和Initialized Git Repository。 之後,我進入Git-> Commit 然後我試圖推送所有的東西,所以遠程 - >推 不知道什麼可能出錯,我無意識地點擊了所有分支的東西,就像有一些東西 - > master或sometig像那樣,我現在真的不知道。
但事情是,它失敗了。所以我不知何故,做一個拉是個好主意,不知道爲什麼。這也是它出錯的地方。點擊所有的東西,它結束了,有一個窗口問我是否要重新組合/合併。我點擊了Rebase。然後另一個窗口彈出,告訴我關於結帳衝突的一些信息,所以我點擊Revert,突然我的文件都消失了。
我設法重新創建了這個。基本上它發生在我有一個項目時,我從GitHub的空項目中拉出來。有什麼辦法讓我的文件恢復嗎?
編輯:從控制檯輸出
4b83b06 (HEAD -> master, origin/master) [email protected]{0}: pull --no-rebase --progress origin: Fast-forward
d47acf2 [email protected]{1}:
4b83b06 (HEAD -> master, origin/master) [email protected]{2}: commit: Wa
d47acf2 [email protected]{3}: checkout: moving from HEAD to master
d47acf2 [email protected]{4}: checkout: moving from master to origin/master
d47acf2 [email protected]{5}: rebase finished: returning to refs/heads/master
d47acf2 [email protected]{6}: checkout: moving from master to d47acf26594fc3d07b7709ff38a56284267ab993
330a8a3 [email protected]{7}: commit (initial):
Git的居留制:
$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: nbproject/private/private.xml
Untracked files:
(use "git add <file>..." to include in what will be committed)
nbproject/project.properties
no changes added to commit (use "git add" and/or "git commit -a")
的chceckout消息:的
$ git checkout 330a8a3
error: Your local changes to the following files would be overwritten by checkout:
nbproject/private/private.xml
Please commit your changes or stash them before you switch branches.
error: The following untracked working tree files would be overwritten by checkout:
nbproject/project.properties
Please move or remove them before you switch branches.
Aborting
打開一個終端,並鍵入'git reflog'。然後'git checkout'之前的提交散列之前。rebasease。 – merlin2011
是否有可能在Windows上? –
Git運行在Windows上,所以它的所有命令也可以在Windows上運行。我會在Windows上推薦'git-bash'。 – merlin2011