I’m new to git..I wonder how to fetch older version from the local repository?
For example
First, I initialize git:
cd ~/app
git init
git add .
git commit -m "init"
Then, I create a file: a.cpp
Then, I update git:
git add .
git commit -m "test"
Now, my question is, how to recover the “app” folder to the version just after the first commit?
I mean, with what command can I remove the a.cpp?
You can do:
This will reset your repo one commit behind, which in this case is the first commit.