你好,我真的有一个奇怪的问题。删除源文件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