Git 先推后撤消提交

Git 先推后撤消提交,git,github,gerrit,Git,Github,Gerrit,我需要写这篇文章,因为我无法为我的案例找到合适的答案,很难表达我的场景,所以下面是事件的顺序:(很抱歉问了这么长的问题)TIA 我检查了这些链接和其他链接,但没有回答:有一个链接存在类似问题,他和我都没有成功 1: I did "commit and push" using intellij 2: It failed as it was not setup properly (thought if pull/checkout works , push will also w

我需要写这篇文章,因为我无法为我的案例找到合适的答案,很难表达我的场景,所以下面是事件的顺序:(很抱歉问了这么长的问题)TIA


我检查了这些链接和其他链接,但没有回答:

有一个链接存在类似问题,他和我都没有成功
1: I did "commit and push" using intellij 
2: It failed as it was not setup properly (thought if pull/checkout works , push will also work ,was 
   wrong)
3: So Pushed the files from git bash (was already commited/staged using intellij in step 1)
4: Getting ready for new push , made changes in files , but saw intellij showing small green mark 
   saying "there are outgoing commits" . but i have pushed the files right?
5: So now i went to Git->log tab inside Intellij and did "Undo Commit..." 
6: I moved it to staged area using git command "git restore --staged <file>" from git bash 
   commandline
7: Then i fired "git restore filename" 
8: "git add filename" for new files followed by git push.
9: Realized that due to "git restore filename" file has been modified to initial state , my changes 
   from file are gone at my local
1: "git log" shows only one commit , so are my commit have been removed from remote repo and i may 
   need to repush to remote once again. Does "Undo Commit" affects Remote push?
2: My local file system is now in inconsistent state i have pushed the files to remote and i dont 
   have the updated files with me , i think after i merge my changes to remote repo and do 
   checkout/pull i will get files with my code changes (if at all it is there).