Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions book/02-git-basics/sections/undoing.asc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Effectively, it's as if the previous commit never happened, and it won't show up
The obvious value to amending commits is to make minor improvements to your last commit, without cluttering your repository history with commit messages of the form, ``Oops, forgot to add a file'' or ``Darn, fixing a typo in last commit''.
====

[NOTE]
====
Only amend commits that are still local and have not been pushed somewhere.
Amending previously pushed commits and force pushing the branch will cause problems for your collaborators.
For more on what happens when you do this and how to recover if you're on the receiving end read <<_rebase_peril>>.
====

[[_unstaging]]
==== Unstaging a Staged File

Expand Down