HG(ROLLBACK)

πŸ’– NAME πŸ’–

hg rollback β€” roll back the last transaction (DANGEROUS) (DEPRECATED)


✨ SYNOPSIS ✨

hg rollback

That's it bestie, no args, no flags required, just vibes and consequences 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so first things first: pls pls pls use hg commit --amend instead of rollback if you're just trying to fix a mistake in the last commit. That's the move. Rollback is not the move. πŸ™ˆ

This command should be used with care. Like, actual care. Here's the tea:

  • There is only one level of rollback, and there is no way to undo a rollback. One and done. No ctrl+Z on the ctrl+Z. 😭
  • It will also restore the dirstate at the time of the last transaction, which means losing any dirstate changes since that time. Gone. Poof.
  • This command does not alter the working directory.

Transactions are used to encapsulate the effects of all commands that create new changesets or propagate existing changesets into a repository. Think of a transaction like a lil time capsule of everything a command did πŸ“¦βœ¨

For example, the following commands are transactional, and their effects can be rolled back:

  • commit
  • import
  • pull
  • push (with this repository as the destination)
  • unbundle
🚨 To avoid permanent data loss, rollback will refuse to rollback a commit transaction if it isn't checked out. Use --force to override this protection. It's giving protective bestie energy and honestly? She's right.

The rollback command can be entirely disabled by setting the ui.rollback configuration setting to false. And if you're here because you want to use rollback and it's disabled β€” hi, welcome β€” you can re-enable the command by setting ui.rollback to true. πŸŽ€

Not me warning you again but: this command is not intended for use on public repositories. Once changes are visible for pull by other users, rolling a transaction back locally is ineffective (someone else may already have pulled the changes). Furthermore, a race is possible with readers of the repository; for example an in-progress pull from the repository may fail if a rollback is performed. It's giving chaos and we are not about that. πŸ’€

Returns 0 on success, 1 if no rollback data is available.


πŸ’… OPTIONS πŸ’…

  • -n, --dry-run β€” do not perform actions, just print output. A little peek, a little preview, zero commitment. main character behavior honestly 🌸
  • -f, --force β€” ignore safety measures. The safety measures said no. You said yes. Rude but iconic. πŸ”₯

and that's the whole page bestie β€” this was the HG(ROLLBACK) manual page, the one and only, rollback section of the hg manual. go forth, commit responsibly, and maybe just use --amend ok? πŸ’–βœ¨πŸ¦‹πŸŽ€πŸ«Ά