How does Git roll back a single file to a specified version?
1. Go to the file directory where the file is located, or find the file path.
View File Modification records
Git log MainActivity. java
2. Roll Back to the specified version
Git reset f7a220761c312d47013c394d750528f9acbc3099 MainActivity. java
3. Submit to local
Git commit MainActivity. java-m "reset to revision"
4. Update to the working directory
Git checkout MainActivity. java (or git pull. Update the entire directory)
5. Submit to remote Repository
Git push origin HEAD: refs/for/branch name
In this way, the specified file is rolled back to the specified version.
How to copy git clone to a specified folder
Git clone remoteurl localdir
For example, git clone git@github.com/somerepo. git/home/admin/somerepo
How does git list all files submitted by a specific version?
Try git ls-files ~~