User Tools

Site Tools


newdevs:git:commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
newdevs:git:commands [2025/02/26 11:54] – [Aliases] slearynewdevs:git:commands [2025/04/04 13:28] (current) – [Useful Git Commands] tmccanna
Line 52: Line 52:
   * ''git reset <nowiki>--hard HEAD</nowiki>'' --> remove last commit   * ''git reset <nowiki>--hard HEAD</nowiki>'' --> remove last commit
   * ''git reset <nowiki>--hard HEAD~2</nowiki>'' --> remove last 2 commits (increment numeral as needed)   * ''git reset <nowiki>--hard HEAD~2</nowiki>'' --> remove last 2 commits (increment numeral as needed)
 +  * ''git revert <hash>'' --> remove a specific commit from a branch that you've applied multiple commits to
   * ''git rm badfile.txt'' --> delete a file (if the file is being tracked, be sure to add a commit message indicating the file has been deleted)   * ''git rm badfile.txt'' --> delete a file (if the file is being tracked, be sure to add a commit message indicating the file has been deleted)
   * ''git show <hash>'' --> display the commit text and differences of the specified commmit   * ''git show <hash>'' --> display the commit text and differences of the specified commmit
newdevs/git/commands.1740588863.txt.gz · Last modified: 2025/02/26 11:54 by sleary

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.