I imported an external project into my project by dragging its project file into mine. It didn't work. Now those files show up whenever I check something in. I don't want them and I never select them at checkin, but how do I get rid of them? I don't find them in the underlying file system, and I haven't found any controls that will get rid of them. They appear in the source control navigator under the changes tab as Local Changes.
Asked
Active
Viewed 531 times
1
-
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jan 09 '22 at 00:56
1 Answers
0
As far as I understand, you have a project in the local area that you version control with git
. You tried something new on the project after the last commit. But you want to cancel the changes and go back to when the last commit was made. In this case you can use the following commands:
# Undo changes made to tracked files
git reset HEAD --hard
# Delete untracked files
git clean -f
# Delete untracked files and directories
git clean -fd
If there is valuable data between the last commit and the current state, you will lose as a result of the above operations. To prevent this situation, you can choose the following way:
# Secure the difference between the last commit and the current state
git commit -m "recovery"
# Revert to two previous commits
git reset HEAD~2
References

Sercan
- 4,739
- 3
- 17
- 36