可以通过命令行查看(输入git log),也可以通过github网站图形化界面查看版本号: 2.使用“git revert -n 版本号”反做,并使用“git commit -m 版本名”提交: (1)反做,使用“git revert -n 版本号”命令。如下命令,我们反做版本号为8b89621的版本: 代码语言:javascript 代码运行次数:0 运行 AI代码
[<paths>...] -q, --quiet be quiet, only report errors --mixed reset HEAD and index --soft reset only HEAD --hard reset HEAD, index and working tree --merge reset HEAD, index and working tree --keep reset HEAD but keep local changes --recurse-submodules[=<reset>] control ...
第一种:改动没有被提交(commit)。在这种情况下,使用svnrevert命令即可。需要注意的有两点,1.如果取消修改的是单个文件的话,使用svnrevertfilepath;2.如果取消修改的目录的时候,使用svnrevert-Rfilepath,这样就可以递归地取消对整个目录中文件的改动。第二种:改动已经被提交(com...
第一种:改动没有被提交(commit)。在这种情况下,使用svnrevert命令即可。需要注意的有两点,1.如果取消修改的是单个文件的话,使用svnrevertfilepath;2.如果取消修改的目录的时候,使用svnrevert-Rfilepath,这样就可以递归地取消对整个目录中文件的改动。第二种:改动已经被提交(com...
--keep reset HEAD but keep local changes --recurse-submodules[=<reset>] control recursive updating of submodules -p, --patch select hunks interactively -N, --intent-to-add record only the fact that removed paths will be added later ...
Keep the commits small: remember to keeps the commits small otherwise large commits are difficult to resolver and creates conflicts if you want to revert some code down the line Reverting a Revert When you revert a commit, Git creates a new commit that undo's the changes of the specific com...
When you commit to your local repository withgit commit, Git records your changes. Because you did not push to a remote repository yet, your changes are not public or shared with others. At this point, you can undo your changes.
--keep Resets index entries and updates files in the working tree that are different between<commit>and HEAD. If a file that is different between<commit>and HEAD has local changes, reset is aborted. !!!If you want to undo a commit other than the latest on a branch, git-revert(1) is...
To revert a commit using GitKraken Client, simply right-click on the commit you want to revert from the central graph and selectRevert commitfrom the context menu. You will then be asked if you want to immediately commit the changes; from here you can choose to save the reverted commit, ...
Today I learned how to revert the last Git commit but keep the changes: git reset --soft HEAD ~1 Fix more common git mistakes: Include.js. Further Reading Revert last commit but keep all the changes to the files with git reset –soft HEAD~1