Reputation: 3
I was suppose to copy files on my CentOS 7 machine from a remote branch of git repo. I created a new folder at incorrect location and clone the repo. After this I have checkout the remote branch also.
I did following steps: 1. Git Clone ( Worked fine) 2. Git Checkout branch name ( worked fine)
Unfortunately, I noticed that I was suppose to create folder at different location and clone the files into that folder then checkout and work on those files. Now my question :
Any help will be appreciated.
Upvotes: 0
Views: 177
Reputation: 90
Sorry, But if I understand your question correctly. You want to move everything to a different location.
So, first of all there is no concept of undoing any checkout. When you checkout to a different branch in git. It just points your HEAD to another commit. That's it. So, if you want to move back to the master
branch (Which is a default branch in most of the cases) you just need to do git checkout master
.
But I think the problem for you is not related to git here, What you want to achieve is move the folder at some other place. So IMO, you just need to move the folder to new location.
mv /incorrect/user/path/FOLDER /correct/folder/path/FOLDER
And now when you change the working directory to the newly placed folder, git will work fine regardless.
Hope this answers your question.
Upvotes: 1