Changes between Version 10 and Version 11 of versionControl/git
- Timestamp:
- Jul 12, 2016 12:02:03 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
versionControl/git
v10 v11 296 296 297 297 298 {{{git reset}}} as the dangerous method. When you undo with {{{git reset}}}(and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo.298 {{{git reset}}} is a dangerous method. When you undo with {{{git reset}}} (and the commits are no longer referenced by any ref or the reflog), there is no way to retrieve the original copy—it is a permanent undo. 299 299 300 300 Remove the specified file from the staging area, but leave the working directory unchanged. This unstages a file without overwriting any changes. … … 429 429 430 430 431 ==== Getting back to the latest commit 432 433 If you know the commit you want to return to is the head of some branch (the default is usually the `master` branch), or is tagged, then you can just 434 435 {{{ 436 git checkout <branchname> 437 }}} 438 439 Another useful command is `git reflog`, to see what other commits your `HEAD` (or any other ref) has pointed to in the past. 440 441 {{{ 442 git reflog 443 }}} 444 445 This is different than `git log` because it lists the hole history, and not just the strictly the antecedent events. 446 447 431 448 == Git Branches == 432 449