Am I working on a file in which my current commit turned out to be bad, and I want to revert to earlier commits for a specific file?
I did a search, it looks like no one answered a similar question (how to undo changes to a file in a previous commit in git) ....
Hope a simple answer?
git checkout <commit-id> file(s)
It will be easy to overwrite, so be careful with your files, which may span multiple files at once. For help, you can check the messages git logwith the necessary files as a filter:
git log
git log <file>
, <file>.
<file>
git reset <commit hash> <filename>
, , , , , , git , . , , , , , .
, , , .
, , (, git gui), , .
Source: https://habr.com/ru/post/1767894/More articles:best practice tips when connecting an ASP.NET application to SQL Server - sql-serverReading FOP images from a database - javaRequire old silverlight version - windows-xpServer 2008 cannot set user rights - windows-server-2008https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1767893/is-there-an-objective-c-git-library-that-would-support-pushpull-against-a-remote-repository&usg=ALkJrhhcJWYsyXVq3N_BWgxQ60UlSxMZkALinq to SQL: aggregation byhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1767896/grant-access-to-informationschema&usg=ALkJrhgfE1VYqwTl-SOQSbcvu3KcoxRbGgDjango: displaying many-to-many fields in a change list - sqlGrails: query associations raise groovy.lang.MissingMethodException - hibernateSystem type exception: Char - c #All Articles