0

In my project under IntelliJ I checkout branch with old version in order to seee how something was done there. I didn't change antyhing and now when I want to return to master I receive this message: Untracked files prevent checkout. Firstly there were only new webdriver file shown which was added to project in later version but now after executing command git status it shows all the class which were added in later version. What happend ? How can I skip it and return to master without breaking my project ?

kris82pl
  • 977
  • 3
  • 12
  • 21

1 Answers1

1

If you don't have any changes that you want to keep for the old branch, you can force checkout to master.

git checkout -f BRANCH-NAME

Edit: I do not use IntelliJ so I can't advise for that. Open a terminal, navigate to your git project and run the above command.

djolf
  • 1,196
  • 6
  • 18
  • After executing command I receive this:Unlink of file 'src/test/resources/drivers/chromedriver110.exe' failed. Should I try again? (y/n) – kris82pl Apr 04 '23 at 08:54
  • check this question: https://stackoverflow.com/questions/4389833/unlink-of-file-failed-should-i-try-again – djolf Apr 04 '23 at 09:07