git 操作命令

138 阅读1分钟



1. 首先查看文件的历史版本。git log /path/to/file

2. 找到你想要还原的版本。如
commit 052c0233bcaef35bbf6e6ebd43bfd6a648e3d93b
Author: panww <panww@gmail.com>
Date: Wed Nov 8 11:48:31 2017 +0800
commit modify/path/to/file

3.
git checkout 052c0233bcaef35bbf6e6ebd43bfd6a648e3d93b /path/to/file
4.commit、push。




码云每次提交git都需要输入用户名和密码的解决办法

git config --global credential.helper store