I'm new to git and I did not do an initial commit. I had a folder on my machine and ran git init, then git pull from the remote respository, and then committed the changes I had made locally. Is it possible to revert changes wrought by the initial pull? Does git init establish anything I can go back to? I want to revert all files to how they were when I ran git init.
Asked
Active
Viewed 120 times
1 Answers
1
It's not entirely sure what your exact situation is. I would suggest you make a backup of the folder before you attempt the following.
This is presuming your most recent commit has the work you want saved, and everthing else can be thrown out. It will put you back to before you ran git init.
git reset HEAD^1
rm -rf .git

Andrew C
- 13,845
- 6
- 50
- 57