0

I'm trying to revert the last commit that I did. I recently had added three submodules into my repository.

enter image description here

When I try to revert the last commit

git revert --no-commit 787d04a

I get:

Unlink of file 'components/CDDDoser' failed. Should I try again? (y/n) n

To resolve this I followed the answers in this link but nothing seems to work: Unlink of file Failed. Should I try again?

  1. Cleaning garbage

    git gc

Didn't fixed it

  1. Opening up Process Explorer:

enter image description here

enter image description here

There doesn't seem to be any program that is also running Git or has my repository opened in it. So this doesn't seem to be the issue

  1. Tried to running git gc as administrator and then reverting the changes with git revert --no-commit 787d04a but it still didn't fixed it

I simply don't know what else to do, it's extremely frustrating. I been trying to troubleshoot this for the whole day. Any help is appreciated, or at least if git revert is not doing the trick because of this problem, are there any other recommendations of alternatives commands that are not git reset that I can do to safely make changes to remote repositories? Thanks.

tadm123
  • 8,294
  • 7
  • 28
  • 44
  • I would try a reboot and then only opening up the terminal (no other applications) and then retrying the command. – Guildenstern May 01 '23 at 09:18
  • It still is not working unfortunately – tadm123 May 01 '23 at 22:37
  • The commit message says adding, so I'm guessing the revert would delete the file? In that case, can you delete the file manually? If no, your problem is not Git related. If yes, after that, try the revert. – TTT May 02 '23 at 02:56
  • @TTT yeah this was just a training that I did when learning `git revert`, I took the simplest scenario, adding a submodule and reverting it would simply delete it, but I get this error. I could do it manually but this was training so I can use it in more complicated scenarios. – tadm123 May 02 '23 at 03:18

0 Answers0